ViroSoundField

A component that enables the control and playback of ambisonic sound files. Refer to Sound under Develop for more information.

Example use:
<ViroSoundField
    source={require("./sound/mysound.wav")}
    rotation={[0, 90, 0]}
    paused={false}
    onFinish={this.onFinishSound}
/>

Props

source (* required)

TypeDescription
PropTypes.oneOfType( [PropTypes.shape( {uri:PropTypes.string} ), PropTypes.number])An ambisonic sound file. Only supports multi-channel audio files.

loop

TypeDescription
booleanSet to true to loop the sound field. This is set to false by default.

muted

TypeDescription
booleanSet to true to mute the sound field. This is set to false by default.

onError

TypeDescription
FunctionCallback invoked when the 360 Image fails to load. The error message is contained in event.nativeEvent.error

onFinish

TypeDescription
FunctionCallback that is called when the sound field is finished playing. This function isn't called at the end of a sound field if looping is enabled.

paused

TypeDescription
booleanSet to true to pause the sound field. This is set to false by default.

rotation

TypeDescription
[number, number, number]The rotation which will be applied to the ambisonic sound.

volume

TypeDescription
numberA 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.

Method

seekToTime(timeInSeconds)

Seek to the given point in the Sound, in seconds.

Parameters

timeInSeconds - The seek position in seconds.