hu2di / react-native-mosquito-sound

Play mosquito sound in React Native (iOS & Android)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

react-native-mosquito-sound

INSTALL

  1. npm install react-native-sound --save react-native link react-native-sound

RESOURCE

  1. Add file "yoursound.mp3" to Resources folder in iOS XCode project

CODE

  1. import Sound from "react-native-sound";

  2. constructor(props) { super(props); Sound.setCategory("Playback"); mSound = new Sound("yoursound.mp3", Sound.MAIN_BUNDLE); }

  3. _playSound() { mSound.play(success => { if (success) { console.log("Success"); } else { console.log("Failure"); mSound.reset(); } }); }

About

About

Play mosquito sound in React Native (iOS & Android)

License:MIT License


Languages

Language:Objective-C 45.7%Language:JavaScript 21.1%Language:Starlark 17.9%Language:Java 15.3%