Mixer(3pm)
๐ Mixer(3pm) โ the Audio::Mixer era ๐
okay bestie, sit down, we're doing sound mixer control in Perl and honestly? it's giving iconic. this is Audio::Mixer, a lil extension for poking at your sound mixer, and the manual is Mixer(3pm) from the User Contributed Perl Documentation corner of the world. let's get into it ๐
โจ NAME โจ
Audio::Mixer โ Perl extension for Sound Mixer control ๐๏ธ๐ฆ
โจ SYNOPSIS โจ
use Audio::Mixer;
$volume = Audio::Mixer::get_cval('vol');
if (Audio::Mixer::set_cval('vol', 50, 40)) {
die("Can't set volume...");
}
like. that's it. you're already a mixer girlie. slay ๐
โจ DESCRIPTION โจ
It's a library to query / set various sound mixer parameters, no cap ๐
This is just a very simple Perl interface which lets you set various sound mixer parameters. The most important one is probably 'vol' (volume) because duh, main character energy ๐. If you wanna know the whole list of mixer parameters, hit up the get_mixer_params() function โ she'll tell you everything, iykyk.
Also super important: all values (lcval, rcval) are numbers in 0-100 range. zero to hundo. that's the whole vibe. ๐ฏ
โจ FUNCTIONS โจ
get_cval(cntrl) โ get that parameter value ๐
Parameters:
cntrlโ name of parameter
Returns:
- in array context:
(lcval, rcval), where:lcvalโ left channel valuercvalโ right channel value
- in scalar context returns value of
get_param_val()(see below, bestie, it's down there ๐ซถ)
set_cval(cntrl, lcval, rcval) โ set that parameter value ๐ฅ
Parameters:
cntrlโ name of parameterlcvalโ left channel valuercvalโ right channel value (optional, if not supplied will be equal tolcval)
Returns: 0 if Ok, -1 if failed ๐ซ
set_source(cntrl) โ set record source ๐ค
Parameters:
cntrlโ name of channel to record from
Returns: 0 if Ok, -1 if failed
get_source(cntrl) โ get record source ๐
Returns:
- name of channel to record from
set_mixer_dev(fname) โ Set mixer device name (optional) โ๏ธ
/dev/mixer is used by default, that's the factory setting bestie.
fnameโ device name
Returns: 0 if Ok
init_mixer() โ Initialize mixer (open it) ๐ธ
okay so here's the tea โ: set_cval() / get_cval() opens / closes the mixer each time they called, unless init_mixer() called before.
In case if init_mixer() called before, all other functions will use already opened device instead of opening it each time. efficiency queen ๐
โจ
close_mixer() โ Close device. ๐ช
Should be called only if init_mixer() was used. don't just close random things, that's rude ๐ญ
get_mixer_params() โ Get list of mixer parameters ๐
Returns: list of parameters names.
๐ LOW LEVEL FUNCTIONS ๐
welcome to the basement bestie, mind the bits ๐
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 (ifx & 0x10000then 2 channels exist)
- lower byte (
- or
-1in case of failure. rude but okay ๐
set_param_val(cntrl, lcval, rcval) โ Set parameter value. ๐ง
Here all parameters are mandatory (in contrast to set_cval()). no skipping, no shortcuts, every arg shows up to the function. periodt.
Parameters:
cntrlโ name of parameterlcvalโ left channel valuercvalโ right channel value
Returns: 0 if Ok, -1 if failed
โ ๏ธ heads up bestie: these low level ones are the raw, no-filter versions โset_param_val()makes you hand over all three args, unlike chill lilset_cval()which letsrcvalslide.
โจ AUTHOR โจ
Sergey Gribov, sergey@sergey.com โ the og, the icon, the moment ๐๐
โจ 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. ๐
โจ SEE ALSO โจ
perl(1)โ go read the mothership, bestie ๐ช
and that's the whole page!! this was perl v5.42.3, dated 2026-08-19, brought to you by the <3 of Mixer(3pm) ๐โจ go forth and mix, you absolute legend ๐ฆ๐
๐ฆ where this page comes from
- ubuntu stonking: libaudio-mixer-perl 0.7-8build7 ยท GPL-1.0-only OR Artistic-1.0-Perl
- ๐ girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms