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 value
    • rcval โ€” 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 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 ๐Ÿซ 


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 (if x & 0x10000 then 2 channels exist)
  • or -1 in 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 parameter
  • lcval โ€” left channel value
  • rcval โ€” 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 lil set_cval() which lets rcval slide.

โœจ 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