.\" -*- mode: troff; coding: utf-8 -*- .\" Automatically generated by Pod::Man 5.01 (Pod::Simple 3.43) .\" .\" Standard preamble: .\" ======================================================================== .de Sp \" Vertical space (when we can't use .PP) .if t .sp .5v .if n .sp .. .de Vb \" Begin verbatim text .ft CW .nf .ne \\$1 .. .de Ve \" End verbatim text .ft R .fi .. .\" \*(C` and \*(C' are quotes in nroff, nothing in troff, for use with C<>. .ie n \{\ . ds C` "" . ds C' "" 'br\} .el\{\ . ds C` . ds C' 'br\} .\" .\" Escape single quotes in literal strings from groff's Unicode transform. .ie \n(.g .ds Aq \(aq .el .ds Aq ' .\" .\" If the F register is >0, we'll generate index entries on stderr for .\" titles (.TH), headers (.SH), subsections (.SS), items (.Ip), and index .\" entries marked with X<> in POD. Of course, you'll have to process the .\" output yourself in some meaningful fashion. .\" .\" Avoid warning from groff about undefined register 'F'. .de IX .. .nr rF 0 .if \n(.g .if rF .nr rF 1 .if (\n(rF:(\n(.g==0)) \{\ . if \nF \{\ . de IX . tm Index:\\$1\t\\n%\t"\\$2" .. . if !\nF==2 \{\ . nr % 0 . nr F 2 . \} . \} .\} .rr rF .\" ======================================================================== .\" .IX Title "Mixer 3pm" .TH Mixer 3pm 2024-03-07 "perl v5.38.2" "User Contributed Perl Documentation" .\" For nroff, turn off justification. Always turn off hyphenation; it makes .\" way too many mistakes in technical documents. .if n .ad l .nh .SH NAME Audio::Mixer \- Perl extension for Sound Mixer control .SH SYNOPSIS .IX Header "SYNOPSIS" .Vb 5 \& use Audio::Mixer; \& $volume = Audio::Mixer::get_cval(\*(Aqvol\*(Aq); \& if (Audio::Mixer::set_cval(\*(Aqvol\*(Aq, 50, 40)) { \& die("Can\*(Aqt set volume..."); \& } .Ve .SH DESCRIPTION .IX Header "DESCRIPTION" Library to query / set various sound mixer parameters. .PP This is just a very simple Perl interface which allows one to set various sound mixer parameters. The most important probably 'vol' (volume). The list of all mixer parameters can be obtained using \fBget_mixer_params()\fR function. .PP All values (lcval, rcval) are numbers in 0\-100 range. .SH FUNCTIONS .IX Header "FUNCTIONS" get_cval(cntrl) \- Get parameter value Parameters: cntrl \- name of parameter Returns: in array context: (lcval, rcval), where: lcval \- left channel value rcval \- right channel value in scalar context returns value of \fBget_param_val()\fR (see below) .PP set_cval(cntrl, lcval, rcval) \- Set parameter value Parameters: cntrl \- name of parameter lcval \- left channel value rcval \- right channel value (optional, if not supplied will be equal to lcval) Returns: 0 if Ok, \-1 if failed .PP set_source(cntrl) \- set record source Parameters: cntrl \- name of channel to record from Returns: 0 if Ok, \-1 if failed .PP get_source(cntrl) \- get record source Returns: name of channel to record from .PP set_mixer_dev(fname) \- Set mixer device name (optional), /dev/mixer is used by default fname \- device name Returns: 0 if Ok .PP \&\fBinit_mixer()\fR \- Initialize mixer (open it) \fBset_cval()\fR / \fBget_cval()\fR opens / closes the mixer each time they called unless \fBinit_mixer()\fR called before. In case if \fBinit_mixer()\fR called before all other functions will use already opened device instead of opening it each time. .PP \&\fBclose_mixer()\fR \- Close device. Should be called only if \fBinit_mixer()\fR was used. .PP \&\fBget_mixer_params()\fR \- Get list of mixer parameters Returns: list of parameters names. .PP LOW LEVEL FUNCTIONS: .PP get_param_val(cntrl) \- Get parameter value Parameter: cntrl \- name of parameter Returns: integer value, which will be constructed as follows: lower byte (x & 0xff) \- value of the left channel (or whole value) next byte (x & 0xff00) \- value of the right channel third byte (x & 0xff0000) \- flags (if x & 0x10000 then 2 channels exist) or \-1 in case of failure. .PP set_param_val(cntrl, lcval, rcval) \- Set parameter value. Here all parameters are mandatory (in contrast to \fBset_cval()\fR). Parameters: cntrl \- name of parameter lcval \- left channel value rcval \- right channel value Returns: 0 if Ok, \-1 if failed .SH AUTHOR .IX Header "AUTHOR" Sergey Gribov, sergey@sergey.com .SH LICENSE .IX Header "LICENSE" Copyright (c) 2001 Sergey Gribov. All rights reserved. This program is free software; you can redistribute it and/or modify it under the same terms as Perl itself. .SH "SEE ALSO" .IX Header "SEE ALSO" \&\fBperl\fR\|(1).