Audio-aKodePlayer
view release on metacpan or search on metacpan
lib/Audio/aKodePlayer.pm view on Meta::CPAN
=head1 FUNCTIONS
=over 4
=item new()
Create a new Audio::aKodePlayer object.
=item open(sinkname)
Opens a player that outputs to the sink sinkname (the sink 'auto' is
recommended, other options are 'alsa', 'jack', 'oss', 'polyp', 'sun',
and maybe other, depending on the aKode installation).
Returns false if the device cannot be opened.
=item close()
Closes the player and releases the output sink.
=item load(filename)
Loads the file from a given filename and prepares it for
playing. Returns false if the file cannot be loaded or decoded.
=item setDecoderPlugin(plugin_name)
Sets the decoder plugin to use. Default is auto-detect.
=item setResamplerPlugin(plugin_name)
Sets the resampler plugin to use. Default is "fast".
=item Audio::aKodePlayer::listPlugins()
Returns the names of available plugins (as an array).
=item Audio::aKodePlayer::listSinks()
Returns the names of available sinks (as an array).
=item Audio::aKodePlayer::listDecoders()
Returns the names of available decoders (as an array).
=item unload()
Unload the file and release any resources allocated while loaded.
=item play()
Start playing.
=item stop()
Stop playing and release any resources allocated while playing.
=item wait()
Waits for the file to finish playing (eof or error) and calls
stop. This blocks the calling thread.
=item detach()
Detach the player from the current thread (once detached, you won't be
able to apply any methods on the player object).
=item pause()
Pause the player.
=item resume()
Resume the player from paused.
=item setVolume(volume)
Set the software-volume. Use a number between 0.0 and 1.0.
=item volume()
Returns the current value of the software-volume.
=item state ()
Returns the current state of the Player, as a number. The constants
Audio::aKodePlayer::CLOSED, Audio::aKodePlayer::OPEN,
Audio::aKodePlayer::LOADED, Audio::aKodePlayer::PLAYING, and
Audio::aKodePlayer::PAUSED can be used, but it is recommended to use
directly the methods isClosed, isOpen, isLoaded, isPlaying, and
isPaused instead.
=item seek(milliseconds)
Attempts a seek to pos milliseconds into the file/stream. Returns true if succesfull.
=item length()
Returns the length of the file/stream in milliseconds. Returns -1 if the length is unknown.
WARNING: current version of aKode (2.0.1) returns lenghts in seconds for WAV files.
=item position()
Returns the current position in file/stream in milliseconds. Returns -1 if the position is unknown.
WARNING: current version of aKode (2.0.1) returns position in seconds for WAV files.
=item seekable()
Returns true if the decoder is seekable.
=item eof()
Returns true if the decoder has reached the end-of-file/stream.
=item decoderError()
Returns true if the decoder has encountered a non-recoverable error.
=item setSampleRate(rate)
Sets the output sample-rate on the resampler to a given value. (May not
work with all sinks.)
( run in 1.050 second using v1.01-cache-2.11-cpan-39bf76dae61 )