SoAudioDevice(3)

πŸ“¦ version 2.5.0, in fedora 43, fedora 44

🌸 SoAudioDevice 🌸

okay bestie, gather round β€” this is the manual page for SoAudioDevice(3) from the Coin library, and yes it's a C++ class, and yes we're gonna make it make sense. πŸ’…


✨ NAME ✨

SoAudioDevice β€” the class that's literally in charge of controlling an audio device. that's it, that's the job. 🎧


πŸŽ€ SYNOPSIS πŸŽ€

First things first, you gotta pull in the header:

#include <Inventor/misc/SoAudioDevice.h>

🫢 Public Member Functions

SbBool init (const SbString &devicetype, const SbString &devicename)
SbBool enable ()
void disable ()
SbBool isEnabled ()
SbBool haveSound ()
void setGain (float gain)
void mute (SbBool mute=1)
void cleanup ()

⭐ Static Public Member Functions

static SoAudioDevice * instance ()

🧚 Friends

class SoAudioDeviceP

πŸ’– Detailed Description πŸ’–

so what is this thing actually doing β€” the SoAudioDevice class is used to control an audio device.

It's the one holding down the whole operation: it handles initialization of an audio device, and it also handles enabling and disabling sound. It's a singleton class, which is a fancy way of saying there's exactly one of it and it's the main character. πŸ‘‘

Now here's the tea bestie: the application programmer does not need to use this class directly, because audio support is enabled by default and the default settings are reasonable. so like, you can just vibe and it works. no cap.

Coin uses OpenAL (http://www.openal.org/, http://developer.soundblaster.com [Games section]) to render audio. OpenAL should work with any soundcard, and on most modern operating systems β€” including Unix, Linux, IRIX, *BSD, Mac OS X and Microsoft Windows. 2 speaker output is always available, and on some OS and soundcard combinations, more advanced speaker configurations are supported. On Microsoft Windows, OpenAL can use DirectSound3D to render audio, which means it supports any speaker configuration the current DirectSound3D driver supports. Configuring speakers happens through the soundcard driver, and it's transparent to both Coin and OpenAL. slay, honestly ✨


πŸ¦‹ Member Function Documentation πŸ¦‹

πŸ’« SoAudioDevice * SoAudioDevice::instance () [static]

Returns a pointer to the SoAudioDevice class, which is a singleton. one class, one pointer, one destiny fr fr. πŸ’€

Referenced by SoVRMLSound::audioRender(), SoSceneManager::render(), SoVRMLAudioClip::SoVRMLAudioClip(), and SoVRMLSound::SoVRMLSound().

πŸ’« SbBool SoAudioDevice::init (const SbString & devicetype, const SbString & devicename)

Initializes the audio device. heads up: currently, the only supported devicetype is "OpenAL". The supported devicename depends on the OS and on installed soundcards and drivers. On Microsoft Windows, supported device names are "DirectSound3D", "DirectSound", and "MMSYSTEM". See the OpenAL documentation (available from http://www.openal.org/) for further information. πŸ“š

The application programmer may override the default setting by calling this method with the wanted device type and name.

The user can also control which devicename OpenAL uses by setting the COIN_SOUND_DRIVER_NAME environment variable. On Microsoft Windows, the default driver name is "DirectSound3D", which should normally be what the user wants.

References disable(), SbString::getString(), haveSound(), SoDebugError::postInfo(), and SoDebugError::postWarning().

πŸ’« SbBool SoAudioDevice::enable ()

Enables sound πŸ”Š β€” turn it up bestie.

References haveSound().

πŸ’« void SoAudioDevice::disable ()

Disables sound. Effectively silencing all audio output. 🀫 shhh, we're being quiet now.

References haveSound(). Referenced by init().

πŸ’« SbBool SoAudioDevice::isEnabled ()

Returns TRUE if audio is enabled. simple as that, iconic behaviour. βœ…

πŸ’« SbBool SoAudioDevice::haveSound ()

returns true if the audio device has been initialized successfully. lowercase true, we're keeping it exactly as written, don't come for me πŸ™ˆ

Referenced by disable(), enable(), and init().

πŸ’« void SoAudioDevice::cleanup ()

Cleans up any allocated resources.

NOTE: now obsoleted, don't use this. Clean-up is triggered from the atexit scheme in "tidbits". like genuinely, do not use it. it's giving deprecated. we said what we said. πŸ’€
References SoDebugError::post().

🌈 Author 🌈

Generated automatically by Doxygen for Coin from the source code. yes the robots wrote it, we're just here to make it cute πŸ€–πŸ’–


and that's the whole page bestie, you ate it up πŸ“

this little love letter to SoAudioDevice(3) came to you courtesy of Coin, Version 2.5.0 β€” iykyk. go make some noise. πŸŽ€βœ¨πŸ¦‹

πŸ“¦ where this page comes from