muroar_setvolume(3)
π 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 from0(truly muted,-InfdB, literally silent, not a peep π) all the way up to65535(full volume,0dB, absolutely sending it π).
β RETURN VALUE β
- on success, this call returns
0β¨ slay. - on error,
-1comes 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
- ubuntu jammy: libmuroar-dev 0.1.13-7 Β· LGPL-3.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms