Skip to content

sound_group

Francisco Dias edited this page Nov 22, 2024 · 4 revisions

Sound Group

FMOD Object: SoundGroup


This module holds functionality related to Sound Groups.

Functions

This module offers a collection of functions designed to address specific tasks and provide utilities for various purposes. Explore the available functions to make the most of the functionalities provided by this module.



Back To Top

fmod_sound_group_set_max_audible

FMOD Function: SoundGroup::setMaxAudible


This function sets the maximum number of playbacks to be audible at once in a sound group.

If playing instances of sounds in this group equal or exceed number specified here, attempts to play more of the sounds will be met with FMOD_RESULT.ERR_MAXAUDIBLE by default. Use fmod_sound_group_set_max_audible_behavior to change the way the sound playback behaves when too many sounds are playing. Muting, failing and stealing behaviors can be specified. See FMOD_SOUNDGROUP_BEHAVIOR.

fmod_sound_group_get_num_playing can be used to determine how many instances of the sounds in the SoundGroup are currently playing.


Syntax:

fmod_sound_group_set_max_audible(sound_group_ref, max_audible)
Argument Type Description
sound_group_ref Real A reference to a SoundGroup.
max_audible Real The maximum number of playbacks to be audible at once. -1 denotes unlimited (default).



Returns:

N/A




Back To Top

fmod_sound_group_get_max_audible

FMOD Function: SoundGroup::getMaxAudible


This function retrieves the maximum number of playbacks to be audible at once in a sound group.


Syntax:

fmod_sound_group_get_max_audible(sound_group_ref)
Argument Type Description
sound_group_ref Real A reference to a SoundGroup.



Returns:

Real




Back To Top

fmod_sound_group_set_max_audible_behavior

FMOD Function: SoundGroup::setMaxAudibleBehavior


This function changes the way the sound playback behaves when too many sounds are playing in a soundgroup.


Syntax:

fmod_sound_group_set_max_audible_behavior(sound_group_ref, behavior)
Argument Type Description
sound_group_ref Real A reference to a SoundGroup.
behavior FMOD_SOUNDGROUP_BEHAVIOR The SoundGroup's max playbacks behavior. The default is FMOD_SOUNDGROUP_BEHAVIOR.FAIL.



Returns:

N/A




Back To Top

fmod_sound_group_get_max_audible_behavior

FMOD Function: SoundGroup::getMaxAudibleBehavior


This function retrieves the current max audible behavior.


Syntax:

fmod_sound_group_get_max_audible_behavior(sound_group_ref)
Argument Type Description
sound_group_ref Real A reference to a SoundGroup.



Returns:

FMOD_SOUNDGROUP_BEHAVIOR




Back To Top

fmod_sound_group_set_mute_fade_speed

FMOD Function: SoundGroup::setMuteFadeSpeed


This function sets a mute fade time.

If a mode besides FMOD_SOUNDGROUP_BEHAVIOR.MUTE is used, the fade speed is ignored.

When more sounds are playing in a SoundGroup than are specified with fmod_sound_group_set_max_audible, the least important Sound (i.e. lowest priority / lowest audible volume due to 3D position, volume, etc.) will fade to silence if FMOD_SOUNDGROUP_BEHAVIOR.MUTE is used, and any previous sounds that were silent because of this rule will fade in if they are more important.


Syntax:

fmod_sound_group_set_mute_fade_speed(sound_group_ref, speed)
Argument Type Description
sound_group_ref Real A reference to a SoundGroup.
speed Real The fade time, in seconds. 0 means no fading (default).



Returns:

N/A




Back To Top

fmod_sound_group_get_mute_fade_speed

FMOD Function: SoundGroup::getMuteFadeSpeed


This function retrieves the current mute fade time, in seconds.


Syntax:

fmod_sound_group_get_mute_fade_speed(sound_group_ref)
Argument Type Description
sound_group_ref Real A reference to a SoundGroup.



Returns:

Real




Back To Top

fmod_sound_group_set_volume

FMOD Function: SoundGroup::setVolume


This function sets the volume of the sound group.

Note

This scales the volume of all Channels playing Sounds in this SoundGroup.


Syntax:

fmod_sound_group_set_volume(sound_group_ref)
Argument Type Description
sound_group_ref Real A reference to a SoundGroup.



Returns:

N/A




Back To Top

fmod_sound_group_get_volume

FMOD Function: SoundGroup::getVolume


This function retrieves the volume level of the sound group.


Syntax:

fmod_sound_group_get_volume(sound_group_ref)
Argument Type Description
sound_group_ref Real A reference to a SoundGroup.



Returns:

Real




Back To Top

fmod_sound_group_get_num_sounds

FMOD Function: SoundGroup::getNumSounds


This function retrieves the current number of Sounds in this SoundGroup.


Syntax:

fmod_sound_group_get_num_sounds(sound_group_ref)
Argument Type Description
sound_group_ref Real A reference to a SoundGroup.



Returns:

Real




Back To Top

fmod_sound_group_get_sound

FMOD Function: SoundGroup::getSound


This function retrieves a sound.

Note

Use fmod_sound_group_get_num_sounds in conjunction with this function to enumerate all sounds in a SoundGroup.


Syntax:

fmod_sound_group_get_sound(sound_group_ref, sound_index)
Argument Type Description
sound_group_ref Real A reference to a SoundGroup.
sound_index Real The index of the sound in the given SoundGroup.



Returns:

Real




Back To Top

fmod_sound_group_get_num_playing

FMOD Function: SoundGroup::getNumPlaying


This function retrieves the number of currently playing Channels for the SoundGroup.

The function returns the number of Channels playing. If the SoundGroup only has one Sound, and that Sound is playing twice, the figure returned will be two.


Syntax:

fmod_sound_group_get_num_playing(sound_group_ref)
Argument Type Description
sound_group_ref Real A reference to a SoundGroup.



Returns:

Real




Back To Top

fmod_sound_group_stop

FMOD Function: SoundGroup::stop


This function stops all sounds within this sound group.


Syntax:

fmod_sound_group_stop(sound_group_ref)
Argument Type Description
sound_group_ref Real A reference to a SoundGroup.



Returns:

N/A




Back To Top

fmod_sound_group_get_name

FMOD Function: SoundGroup::getName


This function retrieves the name of the sound group.


Syntax:

fmod_sound_group_get_name(sound_group_ref)
Argument Type Description
sound_group_ref Real A reference to a SoundGroup.



Returns:

String




Back To Top

fmod_sound_group_release

FMOD Function: SoundGroup::release


This function releases a soundgroup object and returns all sounds back to the master sound group.

Important

You cannot release the master SoundGroup.


Syntax:

fmod_sound_group_release(sound_group_ref)
Argument Type Description
sound_group_ref Real A reference to a SoundGroup.



Returns:

N/A




Back To Top

fmod_sound_group_get_system_object

FMOD Function: SoundGroup::getSystemObject


This function retrieves the parent System object.


Syntax:

fmod_sound_group_get_system_object(sound_group_ref)
Argument Type Description
sound_group_ref Real A reference to a SoundGroup.



Returns:

Real




Back To Top

fmod_sound_group_set_user_data

FMOD Function: SoundGroup::setUserData


This function sets a floating-point user value associated with this object.

Note

While FMOD supports arbitrary User Data, this function only allows you to set a real value (a double-precision floating-point value).


Syntax:

fmod_sound_group_set_user_data(sound_group_ref, data)
Argument Type Description
sound_group_ref Real A reference to a SoundGroup.
data Real The value to set on the object.



Returns:

N/A




Back To Top

fmod_sound_group_get_user_data

FMOD Function: SoundGroup::getUserData


This function retrieves a user value associated with this object, as set with an earlier call to fmod_sound_group_set_user_data.

Note

While FMOD allows arbitrary User Data, this function only allows you to get a real value (a double-precision floating-point value).


Syntax:

fmod_sound_group_get_user_data(sound_group_ref)
Argument Type Description
sound_group_ref Real A reference to a SoundGroup.



Returns:

Real