简体   繁体   中英

Play Audio clip onclick of icon in React Native

[https://i.stack.imgur.com/cNFqa.png][1]

Hi I am trying to make it such that a audio recording would play when my user clicks on the speaker icon in the picture shown above. Would appreciate any help or prompt for me to go towards the correct direction as all I have found on google so far is react native sound players which come with a whole set of play pause and volume buttons which I do not need since the audio clip I have is probably just 2 seconds long which is a simple pronunciation of the number they have selected

You have to use any sound player library to do so.

See: https://www.npmjs.com/package/react-native-sound-player

You can use this library to play audio either local file or from url

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM