|o||Nothing by default as when going OO.|
|o||:simple gives eci() which does most everything, also errmsg and on_error. Or you could just import eci and call the others Audio::Ecasound::errmsg()|
|o||:iam imports many iam commands so that you can use them as perl functions. Basically everything listed by ecasounds int-cmd-list except the single letter commands and hyphens are replaced by underscores. The list is produced at run-time and returned by Audio::Ecasound::get_iam_cmds(). See IAM COMMANDS;|
|o||:std to import the full ecasound control interface detailed in the Ecasound Programmers Guide.|
|o||:raw and raw_r, C functions with minimal wrapping, _r ones are reentrant and must be passed the object returned by eci_init_r(). I dont know why you would use these, presumably you do. These options may be removed in future.|
The procedural and OO interfaces use the same functions, the differences are that when called on an Audio::Ecasound object the reentrant C versions are used so you can have multiple independent engine (with independent options).
The remainder of the functions/methods are the standard Ecasound Control Interface methods but they come in three flavours. The bare function name may be called with or without an object:
<B>B>new()<B>B> Constructor for Audio::Ecasound objects, inherits the on_error and other options from the current package settings (defaults if untouched). <B>eci(ecasound command string, [$float_argument])B> Sends commands to the Ecasound engine. A single command may be called with an optional float argument (to avoid precision loss). Alternatively, multiple commands may be given separated by newlines (with # starting a comment).
If called in non-void context the result of the last command is returned, it may be an integer, float, string (ie. scalar) or a list of strings. Which will depend on the ecasound command, see ecasound-iam for each functions return value.
If there is an error the action given to on_error will be taken. See on_error below for return value caveats when on_error = . Error processing is performed for each command in a multiline command.
<B>on_error(die)B> Set the action to be taken when an error occurs from and eci command, may be die, warn, , confess, ... (default is warn).
When is selected return; is used for an error, that is undef or (). To disamibiguate eci will return or () for no return value and no string list respectively.
<B>B>errmsg()<B>B> The last error message from an eci command. It is not reset so clear it yourself if required errmsg(). This shouldnt be necessary as you can use defined or on_error to find out when errors occur.
use Audio::Ecasound :simple: command($cmd); # or my $e = new Audio::Ecasound; $e = command($cmd);
The other two flavours are low-level, reentrant and non-reentrant. These are thinly wrapped C functions better documented in the ECI document with the ecasound distribution. Just add eci_ to the names below for the non-reentrant version and then add a _r to the end for the reentrant version. The reentrant version takes an extra first argument, the object returned by eci_init_r() which must be destroyed with eci_cleanup_r().
<B>command($cmd_string)B> <B>eci_command_float_arg($cmd_string, B>$float_arg<B>)B> <B>B>$bool<B> = B>eci_error()<B>B> <B>B>$err_str<B> = B>eci_last_error()<B>B> <B>B>$float<B> = B>eci_last_float()<B>B> <B>B>$int<B> = B>eci_last_integer()<B>B> <B>B>$lint<B> = B>eci_last_long_integer()<B>B> <B>B>$str<B> = B>eci_last_string()<B>B> <B>B>$n<B> = B>eci_last_string_list_count()<B>B> <B>B>$str_n<B> = eci_last_string_list_item($n)B> <B>B>$type_str<B> = B>eci_last_type()<B>B> s S i li f
When the :iam tag is imported most of the commands in ecasounds interactive mode become perl functions. The -s become _s to become valid perl names (cop-get is cop_get, etc.) The list is printed with:
use Audio::Ecasound qw(:iam :simple); print join , Audio::Ecasound::get_iam_cmds();
The arguments joined together as a string and then sent to ecasound. This means that float precision is lost, unlike with the two argument eci so use it. Also use eci for command-line style commands like eci "-i /dev/dsp". But most other things you can just use the iam command itself (s/-/_/g):
use Audio::Ecasound qw(:iam :simple); ... # setup stuff print status; start; $v = copp_get; copp_set $v + 1.2;
See the iam_int.pl example file in the eg directory.
See the eg/ subdirectory.
The ecasound command debug could be useful, add eci "debug 63" to the top of your program. The argument is various bits ORd and controls the amount and type of debugging information, see the ecasound documentation of source or just try your favorite powers of two.
There was a bug effecting Audio::Ecasound with ecasound version 2.4.4, causing problems with :iam mode, and test failure (Do you need to predeclare cs_set_length). See <http://www.eca.cx/ecasound-list/2006/12/0007.html> and <http://www.eca.cx/ecasound-list/2006/06/0004.html>.
The libecasoundc library now uses the environment variable ECASOUND to find the ecasound executable. If it is not set then the libarary will print a warning. To suppress it, simply set the ECASOUND variable: eg. export ECASOUND=ecaosund
The ecasound library will still process ~/.ecasoundrc and other setup files for default values. See the library documentation.
(c) 2001-2007 Brad Bowman <email@example.com> This software may be distributed under the same terms as Perl itself.
The Ecasound Programmers Guide and ECI doc, ecasound, ecasound-iam http://eca.cx/, http://www.ladspa.org/
The internals of libecasoundc have been rebuilt and now interact with a running ecasound via a socket using a protocol defined in the Programmers Guide. The C library is now just a compatibility layer and the Python version now talks directly to the socket. It would be straight forward to write an equivalent Perl version should the need arise.
|perl v5.20.3||ECASOUND (3)||2010-07-12|