Sound Management
rooomSpaces Viewer API sound controls for immersive virtual environments. Manage ambient sounds, space audio, environmental effects, and audio atmosphere in 3D virtual spaces.
isAmbientSoundMuted
isAmbientSoundMuted([callback: Function])
Returns the current mute state of ambient environmental sounds in the virtual space.
api.isAmbientSoundMuted(function(isMuted){
console.log('Ambient sound muted:', isMuted); // true/false
});unmuteAmbientSound
unmuteAmbientSound([callback: Function])
Enables ambient environmental sounds.
api.unmuteAmbientSound(function(){
console.log('Ambient sounds enabled');
});muteAmbientSound
muteAmbientSound([callback: Function])
Disables ambient environmental sounds. Useful for creating quiet environments or when audio conflicts with other media.
api.muteAmbientSound(function(){
console.log('Ambient sounds muted');
});areAllSoundsMuted
areAllSoundsMuted([callback: Function])
Returns whether all audio sources in the virtual space are currently muted.
api.areAllSoundsMuted(function(allMuted){
console.log('All sounds muted:', allMuted); // true/false
});muteAllSound
muteAllSound([callback: Function])
Mutes all audio sources in the virtual space, including ambient sounds, object sounds, videos, and voice chat.
api.muteAllSound(function(){
console.log('All sounds muted');
});unmuteAllSound
unmuteAllSound([callback: Function])
Deprecated: This function is deprecated. Use unmuteSpace() instead.
Enables all audio sources in the virtual space.
api.unmuteAllSound(function(){
console.log('All sounds enabled (deprecated - use unmuteSpace)');
});muteSpace
muteSpace([callback: Function])
Mutes all space-related audio including ambient sounds, object sounds, videos, live streams, playlists, and voice chat.
api.muteSpace(function(){
console.log('All space audio muted');
});unmuteSpace
unmuteSpace([callback: Function])
Enables all space-related audio sources.
api.unmuteSpace(function(){
console.log('All space audio enabled');
});getIsSpaceMuted
getIsSpaceMuted([callback: Function])
Returns the current mute state of all space audio sources.
api.getIsSpaceMuted(function(isMuted){
console.log('Space audio muted:', isMuted); // true/false
});Best Practices
Ambient Sound:
- Use ambient sounds to establish atmosphere and location context
- Consider user preferences and provide audio controls
- Balance audio levels to avoid overwhelming the visual experience
Performance:
- Mute audio when the space is not in focus to save bandwidth
- Use
muteSpace()for comprehensive audio control - Monitor audio state with getter functions for UI synchronization