{"_id":"59bc03d31d2d8d001a344598","category":{"_id":"59bc03d31d2d8d001a344583","version":"59bc03d31d2d8d001a34457d","project":"578c4badbd223d2000cc1441","__v":0,"sync":{"url":"","isSync":false},"reference":false,"createdAt":"2016-08-01T23:04:12.838Z","from_sync":false,"order":6,"slug":"api-reference","title":"API Reference"},"project":"578c4badbd223d2000cc1441","user":"576c22a3808cf02b00d37419","parentDoc":null,"version":{"_id":"59bc03d31d2d8d001a34457d","project":"578c4badbd223d2000cc1441","__v":2,"createdAt":"2017-09-15T16:46:11.721Z","releaseDate":"2017-09-15T16:46:11.721Z","categories":["59bc03d31d2d8d001a34457e","59bc03d31d2d8d001a34457f","59bc03d31d2d8d001a344580","59bc03d31d2d8d001a344581","59bc03d31d2d8d001a344582","59bc03d31d2d8d001a344583","59bc284b7c3f420010f965e6"],"is_deprecated":false,"is_hidden":false,"is_beta":false,"is_stable":true,"codename":"","version_clean":"2.0.0","version":"2.0.0"},"__v":0,"updates":[],"next":{"pages":[],"description":""},"createdAt":"2017-03-18T01:06:46.249Z","link_external":false,"link_url":"","githubsync":"","sync_unique":"","hidden":false,"api":{"settings":"","results":{"codes":[]},"auth":"required","params":[],"url":""},"isReference":false,"order":29,"body":"A component that enables the user play and control mono and stereo sound effects. Refer to [Sound](doc:audio) under Develop for more information.\n\n######Example use:\n```\n<ViroSound\n    source={require(\"./sound/mysound.mp3\")}\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\\nThe sound source, either a mono or stereo audio file. Supported extensions include .mp3 and .wav.\",\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. This is set to false by default.\",\n    \"1-1\": \"**PropTypes.bool**\\n\\nSet to true to mute the sound. 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 is finished playing. This function isn't called at the end of a sound if looping is enabled.\",\n    \"4-0\": \"**paused**\",\n    \"4-1\": \"**PropTypes.bool**\\n\\nSet to true to pause the sound. This is set to false by default.\",\n    \"5-0\": \"**volume**\",\n    \"5-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 Sound fails to load. The error message is contained in event.nativeEvent.error\"\n  },\n  \"cols\": 2,\n  \"rows\": 6\n}\n[/block]","excerpt":"","slug":"virosounds","type":"basic","title":"ViroSound"}
A component that enables the user play and control mono and stereo sound effects. Refer to [Sound](doc:audio) under Develop for more information. ######Example use: ``` <ViroSound source={require("./sound/mysound.mp3")} 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\nThe sound source, either a mono or stereo audio file. Supported extensions include .mp3 and .wav.", "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. This is set to false by default.", "1-1": "**PropTypes.bool**\n\nSet to true to mute the sound. This is set to false by default.", "3-0": "**onFinish**", "3-1": "**React.PropTypes.func**\n\nCallback that is called when the sound is finished playing. This function isn't called at the end of a sound if looping is enabled.", "4-0": "**paused**", "4-1": "**PropTypes.bool**\n\nSet to true to pause the sound. This is set to false by default.", "5-0": "**volume**", "5-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 Sound fails to load. The error message is contained in event.nativeEvent.error" }, "cols": 2, "rows": 6 } [/block]