hyochan / react-native-audio-recorder-player

react-native native module for audio recorder and player.
MIT License
715 stars 213 forks source link

[Feature request] Stream in chunks #275

Closed sayem314 closed 3 years ago

sayem314 commented 3 years ago

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.

hyochan commented 3 years ago

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

hyochan commented 3 years ago

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

Closes via #284

milesscherrer commented 3 years ago

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.

franbe7 commented 2 years ago

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

tragicmj commented 2 years ago

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

devlprkhan commented 9 months ago

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 :(,

H3tansh commented 2 months ago

@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

saintpepsicola commented 2 months ago

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

devlprkhan commented 2 months ago

@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.

H3tansh commented 2 months ago

@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 Sendingdatawith no listeners registered.

IF possible please share the patch for iOS as well.