{"_id":"5b8469e2146f290003ee2559","category":{"_id":"5b8469e2146f290003ee2500","version":"5b8469e2146f290003ee2585","project":"578c4badbd223d2000cc1441","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-08-01T23:04:12.838Z","from_sync":false,"order":8,"slug":"api-reference","title":"API Reference"},"parentDoc":null,"project":"578c4badbd223d2000cc1441","user":"576c22a3808cf02b00d37419","version":{"_id":"5b8469e2146f290003ee2585","project":"578c4badbd223d2000cc1441","__v":0,"forked_from":"5b74987b8326970003cfc12d","createdAt":"2018-04-23T20:03:35.726Z","releaseDate":"2018-04-23T20:03:35.726Z","categories":["5b8469e2146f290003ee24fb","5b8469e2146f290003ee24fc","5b8469e2146f290003ee24fd","5b8469e2146f290003ee24fe","5b8469e2146f290003ee24ff","5b8469e2146f290003ee2500","5b8469e2146f290003ee2501","5b8469e2146f290003ee2502","5b8469e2146f290003ee2503"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.10.0","version":"2.10.0"},"githubsync":"","__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-03-18T01:09:44.923Z","link_external":false,"link_url":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":37,"body":"A component that enables the control and playback of ambisonic sound files. Refer to [Sound](doc:audio) under Develop for more information.\n\n######Example use:\n[block:code]\n{\n  \"codes\": [\n    {\n      \"code\": \"<ViroSoundField\\n    source={require(\\\"./sound/mysound.wav\\\")}\\n    rotation={[0,90,0]}\\n    paused={false}\\n    onFinish={this.onFinishSound} />\",\n      \"language\": \"javascript\"\n    }\n  ]\n}\n[/block]\n\n[block:api-header]\n{\n  \"type\": \"basic\",\n  \"title\": \"Props\"\n}\n[/block]\n##Required props\n[block:parameters]\n{\n  \"data\": {\n    \"h-0\": \"PropKey\",\n    \"h-1\": \"PropType\",\n    \"0-1\": \"**PropTypes.oneOfType( [PropTypes.shape( {uri:PropTypes.string} ), PropTypes.number])**\\n\\nAn ambisonic sound file. Only supports multi-channel audio files.\",\n    \"0-0\": \"**source**\"\n  },\n  \"cols\": 2,\n  \"rows\": 1\n}\n[/block]\n##Optional Props\n[block:parameters]\n{\n  \"data\": {\n    \"0-0\": \"**loop**\",\n    \"1-0\": \"**muted**\",\n    \"h-0\": \"PropKey\",\n    \"h-1\": \"PropType\",\n    \"0-1\": \"**PropTypes.bool**\\n\\nSet to true to loop the sound field. This is set to false by default.\",\n    \"1-1\": \"**PropTypes.bool**\\n\\nSet to true to mute the sound field. This is set to false by default.\",\n    \"3-0\": \"**onFinish**\",\n    \"3-1\": \"**React.PropTypes.func**\\n\\nCallback 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.\",\n    \"4-0\": \"**paused**\",\n    \"4-1\": \"**PropTypes.bool**\\n\\nSet to true to pause the sound field. This is set to false by default.\",\n    \"6-0\": \"**volume**\",\n    \"6-1\": \"**PropTypes.number**\\n\\nA 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.\",\n    \"2-0\": \"**onError**\",\n    \"2-1\": \"**React.PropTypes.func**\\n\\nCallback invoked when the 360 Image fails to load. The error message is contained in event.nativeEvent.error\",\n    \"5-0\": \"**rotation**\",\n    \"5-1\": \"**PropTypes.arrayOf(PropTypes.number),**\\n\\nThe rotation which will be applied to the ambisonic sound.\"\n  },\n  \"cols\": 2,\n  \"rows\": 7\n}\n[/block]","excerpt":"","slug":"virosoundfield","type":"basic","title":"ViroSoundField"}
A component that enables the control and playback of ambisonic sound files. Refer to [Sound](doc:audio) under Develop for more information. ######Example use: [block:code] { "codes": [ { "code": "<ViroSoundField\n source={require(\"./sound/mysound.wav\")}\n rotation={[0,90,0]}\n paused={false}\n onFinish={this.onFinishSound} />", "language": "javascript" } ] } [/block] [block:api-header] { "type": "basic", "title": "Props" } [/block] ##Required props [block:parameters] { "data": { "h-0": "PropKey", "h-1": "PropType", "0-1": "**PropTypes.oneOfType( [PropTypes.shape( {uri:PropTypes.string} ), PropTypes.number])**\n\nAn ambisonic sound file. Only supports multi-channel audio files.", "0-0": "**source**" }, "cols": 2, "rows": 1 } [/block] ##Optional Props [block:parameters] { "data": { "0-0": "**loop**", "1-0": "**muted**", "h-0": "PropKey", "h-1": "PropType", "0-1": "**PropTypes.bool**\n\nSet to true to loop the sound field. This is set to false by default.", "1-1": "**PropTypes.bool**\n\nSet to true to mute the sound field. This is set to false by default.", "3-0": "**onFinish**", "3-1": "**React.PropTypes.func**\n\nCallback 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.", "4-0": "**paused**", "4-1": "**PropTypes.bool**\n\nSet to true to pause the sound field. This is set to false by default.", "6-0": "**volume**", "6-1": "**PropTypes.number**\n\nA 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.", "2-0": "**onError**", "2-1": "**React.PropTypes.func**\n\nCallback invoked when the 360 Image fails to load. The error message is contained in event.nativeEvent.error", "5-0": "**rotation**", "5-1": "**PropTypes.arrayOf(PropTypes.number),**\n\nThe rotation which will be applied to the ambisonic sound." }, "cols": 2, "rows": 7 } [/block]