PulseAudio - An object oriented interface to pacmd.
This is a suite of tools that should make scripting PulseAudio simplier. Please see further docs in PulseAudio::Backend::Utilities, PulseAudio::Sink, PulseAudio::Source.
This module provides an object oriented interface into the Pulse configuration pacmd.
use PulseAudio; $pa = PulseAudio->new; $pa = PulseAudio->new( pulse_server => '192.168.1.102' ); ## Return the first sink where {properties}{device.bus_path} eq pci-0000:00:1b.0 $sink = $pa->get_sink_by( ['properties', 'device.bus_path'] => 'pci-0000:00:1b.0' ) ## But alas, sources have monitors and generic sound interfaces at the same bus_path! $sink = $pa->get_sink_by( ['properties', 'device.bus_path'] => 'pci-0000:00:1b.0' , ['properties', 'device.class'] => 'sound' ) $sink = $pa->get_sink_by_index(5); $sink->set_sink_volume('50%'); # Execute VLC with the B<PULSE_SINK> environmental variable set the sink's index. $sink->exec( '/usr/bin/vlc', 'arg1' ); $sink->exec({ prog => '/usr/bin/vlc', args => ['arg1'] }); ## Perhaps make a Skype conference call using a specific hardware conf? $pa->exec( sink => $sink , source => $source , prog => '/usr/bin/skype' , args => ['--callto','btrlistener021'] ); # Set the sinks's volume $sink->set_sink_volume( 0x10000 ); # Sets volume to max; $sink->set_sink_volume( 'MAX' ); # Sets volume to max;
The get_by methods take alist of array refs a value and return the first object that matches. The array-ref corresponds to the depth and location of the value to check against. For more selectivity, add more than key value pairs; see the SYNOPSIS for an example. Interally, smart-match is used -- feel free to send regex $values.
Retreive the default.
Return the specific requested object by unique id 'index' (or name in the case of PulseAudio::Samples).
DO READ: Commands (doc/Commands.pod)
You can find documentation for this module with the perldoc command.
perldoc PulseAudio
You can also look for information at:
RT: CPAN's request tracker (report bugs here)
http://rt.cpan.org/NoAuth/Bugs.html?Dist=PulseAudio
AnnoCPAN: Annotated CPAN documentation
http://annocpan.org/dist/PulseAudio
CPAN Ratings
http://cpanratings.perl.org/d/PulseAudio
Search CPAN
http://search.cpan.org/dist/PulseAudio/
Copyright 2012 Evan Carroll.
This program is free software; you can redistribute it and/or modify it under the terms of either: the GNU General Public License as published by the Free Software Foundation; or the Artistic License.
See http://dev.perl.org/licenses/ for more information.
To install PulseAudio, copy and paste the appropriate command in to your terminal.
cpanm
cpanm PulseAudio
CPAN shell
perl -MCPAN -e shell install PulseAudio
For more information on module installation, please visit the detailed CPAN module installation guide.