{"_id":"5a06037134873d0010b3922f","category":{"_id":"5a06037134873d0010b39204","version":"5a06037134873d0010b391fe","project":"578c4badbd223d2000cc1441","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-08-01T23:04:12.838Z","from_sync":false,"order":5,"slug":"api-reference","title":"API Reference"},"parentDoc":null,"project":"578c4badbd223d2000cc1441","user":"576c22a3808cf02b00d37419","version":{"_id":"5a06037134873d0010b391fe","project":"578c4badbd223d2000cc1441","__v":1,"createdAt":"2017-11-10T19:52:17.163Z","releaseDate":"2017-11-10T19:52:17.163Z","categories":["5a06037134873d0010b391ff","5a06037134873d0010b39200","5a06037134873d0010b39201","5a06037134873d0010b39202","5a06037134873d0010b39203","5a06037134873d0010b39204"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.1.0","version":"2.1.0"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-03-18T01:09:44.923Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"results":{"codes":[]},"settings":"","auth":"required","params":[],"url":""},"isReference":false,"order":30,"body":"[block:callout]\n{\n  \"type\": \"danger\",\n  \"title\": \"Only Available on Android (Cardboard for Android, GearVR and Daydream)\",\n  \"body\": \"This component will be available on Cardboard for iOS, but will simply act like a ViroSound\"\n}\n[/block]\n\nA 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```\n<ViroSoundField\n    source={require(\"./sound/mysound.wav\")}\n    rotation={[0,90,0]}\n    paused={false}\n    onLoadEnd={this._onLoadEnd} />\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"}
[block:callout] { "type": "danger", "title": "Only Available on Android (Cardboard for Android, GearVR and Daydream)", "body": "This component will be available on Cardboard for iOS, but will simply act like a ViroSound" } [/block] A component that enables the control and playback of ambisonic sound files. Refer to [Sound](doc:audio) under Develop for more information. ######Example use: ``` <ViroSoundField source={require("./sound/mysound.wav")} rotation={[0,90,0]} paused={false} onLoadEnd={this._onLoadEnd} /> ``` [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]