A component that represents a sound in 3D space. Must be a single-channel sound (mono) and can be placed within a ViroNode or ViroAnimatedComponent which changes its position relative to the user. Refer to Sound under Develop for more information.
JavaScript
<ViroSpatialSound
source={require("./sound/mysound.wav")}
position={[0, 0, -3]}
onFinish={this.onFinishSound}
/>
Type Description ImageSourcePropType The source of a spatial sound. Must be a single-channel audio file.
Type Description boolean Set to true to loop the spatial sound. This is set to false by default.
Type Description number A distance after which the audio can not be heard.
Type Description number A distance after which the audio will begin to attenuate until maxDistance where the sound is completely gone.
Type Description boolean Set to true to mute the spatial sound. This is set to false by default.
Type Description Function Callback invoked when the 360 Image fails to load. The error message is contained in event.nativeEvent.error
Type Description Function Callback that is called when the spatial sound is finished playing. This function isn't called at the end of a spatial sound if looping is enabled.
Type Description boolean Set to true to pause the spatial sound. This is set to false by default.
Type Description "None" | "Linear" | "Logarithmic" The rolloff model which determines how the sound volume will fall off between minDistance and maxDistance. Accepts the following values:None
Linear
* Logarithmic
Type Description number A number represented volume from 0 to 1. Max volume is equal to 1. Min volume is equal to 0. This is set to 1 by default.
Type Description [number, number, number] Cartesian position of the sound in 3D world space, specified as [x, y, z].
Seek to the given point in the Sound, in seconds.
timeInSeconds - The seek position in seconds.