muroar_setvolume(3)

πŸ“¦ version 0.1.13, in ubuntu jammy

πŸ’– muroar_setvolume β€” setting the vibe (volume) of a stream, RoarAudio style πŸ’–

okay bestie, welcome to the muRoar Programmer's Manual page for muroar_setvolume(3). yes it's a section 3 function, yes it's iconic, let's get into it πŸŽ€


✨ NAME ✨

muroar_setvolume β€” Set volume of a stream on a RoarAudio sound server 🎚️✨


🌸 SYNOPSIS 🌸

#include <muroar.h>

int muroar_setvolume   (muroar_t fh, int stream, long unsigned int left,
long unsigned int right);

πŸ¦‹ DESCRIPTION πŸ¦‹

so this function sets the volume of a stream on a sound server that supports the RoarAudio protocol. it takes a connected control connection β€” one you made with roar_connect(3) β€” and uses it to talk to the server you're already connected to. and then, on top of that, it takes the stream ID and the volume for the left and right channel. simple as that πŸ’…

it works for mono streams AND stereo streams, no discrimination here 🫢. it also supports setting the volume on multi-channel streams β€” but only if the server supports UNMAPPED mode. iykyk.

and if you wanna set a volume in mono? just give the exact same volume for both channels (left and right). that's the whole trick, periodt πŸ’–


πŸ’… PARAMETERS πŸ’…

  • fh β€” the connected control connection. your lil hotline to the server, bestie πŸŽ€
  • stream β€” the ID of the stream you're setting the volume for. gotta know which one you're turning up πŸ”₯
  • left, right β€” the volume of the corresponding channel. it's a 16 bit unsigned number, so the range goes from 0 (truly muted, -InfdB, literally silent, not a peep 😭) all the way up to 65535 (full volume, 0dB, absolutely sending it πŸ‘‘).

⭐ RETURN VALUE ⭐

  • on success, this call returns 0 ✨ slay.
  • on error, -1 comes back. πŸ’€

😭 BUGS 😭

in a failure there is no way to tell what was going wrong. like, zero clues, no crumbs, nothing πŸ™ˆ

and in case of failure, the control connection needs to be closed with muroar_close(3). no leaving it hanging around, that's rude.


🌈 HISTORY 🌈

this function first appeared in muRoar version 0.1.8. a legend from day one, fr fr.


πŸ‘‘ SEE ALSO πŸ‘‘

muroar_connect(3), muroar_close(3), RoarAudio(7).


muRoar Β· April 2012 β€” that's the source, the version, and the date bestie, and that's a wrap πŸŽ€πŸ’– stay loud, stay mapped, mwah 🫢

πŸ“¦ where this page comes from