reki2000 / mp-audio-stream

Flutter plug-in for multi platform simple audio stream playback with real-time generated audio data streams
MIT License
9 stars 4 forks source link

Is there an easy way to check if the audioStream is currently playing? #20

Open nialljawad96 opened 7 months ago

nialljawad96 commented 7 months ago

Is there an easy way to check if the audioStream is currently processing Float32List? (I.e. the audio is playing)

@reki2000

reki2000 commented 6 months ago

@nialljawad96 Unfortunately, there isn't a straightforward way to check. Monitoring whether the exhaust count from stat is increasing might help, but it's not very simple. Why do you need to determine whether it's processing? The mp-audio-stream has a buffer that is always being processed, unless the buffer is empty. However, audio might still be playing even if the mp-audio-stream's buffer is empty. Adding a status that shows the mp-audio-stream's internal buffer is empty or not in stat response might help.

charliefabley commented 2 weeks ago

I'm finding that after 30 seconds or so the audio becomes completely unstable. I'm streaming from Cartesia using a web socket. The problem I think is that it doesn't matter what I set the values to, the audio buffer is getting full. Do you think this could be the reason and is there a way of removing data that has already been played from the audio buffer? Or something that would allow for the audio stream to play indefinitely.