hyochan/react-native-audio-recorder-player

[Feature request] Stream in chunks

sayem314 opened this issue · 10 comments

Version of react-native-audio-recorder-player

2.6.2

Platforms you faced the error (IOS or Android or both?)

both

Behavior

When playing a large podcast file from remote location it's not streaming in chunks/real-time but instead, it's downloading it fully first. The server is sending proper responses. react-native-video package plays as expected so it's not server-side issue.

This is a limitation on AVAudioPlayer which we are using. Currently, I am looking to migrate to AVPlayer as described in #284

Please try 3.0.0-beta.1 if you have time.

Closes via #284

Not sure if streaming works in 3.1.0, or at least playback has a long delay on remote files. Starting playback of remote files takes > 3 seconds even on fast network.

Tried to add:

audioPlayer.automaticallyWaitsToMinimizeStalling = false
audioPlayerItem.preferredForwardBufferDuration = 1.0
audioPlayer.playImmediately(atRate: 1.0)

but playback still takes > 3 seconds to start and these settings seems to have no effect.

As it audio file size does not seem change start delay, maybe streaming is working. But then it is still a problem that there is a major delay on start play.

@milesscherrer I'm having the same problem, could you solve it?

Facing the same problem, any solution found?? @milesscherrer
This issue should be open @hyochan

Same is there any way to stream audio recording and send the live audio recording chunks using data stream methods to our server, my main issue is that there is any way? to get realtime audio chunks while recording :(,

@devlprkhan have you find any solution to record audio stream and send audio chunks to server ?, I am in urgent need of help regarding that

@milesscherrer @devlprkhan Did you guys find any solution? Thanks

@saintpepsicola @H3tansh

Yes, I was able to find a solution using another package called react-native-live-audio-stream.

It works well on Android, but I did encounter some issues on iOS.

If you’re facing similar issues on iOS, let me know, I write a patch for it so share it with you.

For streaming audio recording and sending live audio recording chunks to the server in real-time, this package has been helpful.

@devlprkhan Can you please share your working code snippet if possible,
Thanks a lot!!!

Edit:- I guess I've the same issue in iOS, it is not recording anything
And giving warning Sending data with no listeners registered.

IF possible please share the patch for iOS as well.