简体   繁体   English

使用React Native进行音频流

[英]Audio streaming with React native

I need to develop an app for a client that streams audio files from the network (both Android and iOS). 我需要为一个客户端开发一个应用程序,该客户端可以从网络(Android和iOS)中流式传输音频文件。 I plan to use react-native-audio-streaming component. 我计划使用react-native-audio-streaming组件。 Clients biggest concern is that streamed files are not stored locally. 客户端最大的担忧是流文件不是存储在本地。 Does anyone know is that the case with react-native-audio-streaming? 有谁知道react-native-音频流是这种情况吗?

You can use this npm module. 您可以使用此npm模块。 It will stream the audio/video using the inbuilt player on the device. 它将使用设备上的内置播放器流式传输音频/视频。 https://www.npmjs.com/package/react-native-native-video-player https://www.npmjs.com/package/react-native-native-video-player

You can use react-native-audio-streamer to stream the audios. 您可以使用react-native-audio-streamer来流式传输音频。 It works on both iOS & Android. 它可以在iOS和Android上运行。 And is very easy to use. 并且非常易于使用。 Moreover it has got built in functions to handle interruptions, for example to pause the audio you just have to call this function RNAudioStreamer.pause() and to play it back call RNAudioStreamer.play() . 此外,它具有内置的功能来处理中断,例如暂停音频,您只需要调用此函数RNAudioStreamer.pause()并播放即可调用RNAudioStreamer.play()

Good luck. 祝好运。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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