flutter_sound icon indicating copy to clipboard operation
flutter_sound copied to clipboard

startPlayerFromStream no sound on android, same code works on IOS and Web

Open hellking888 opened this issue 5 months ago • 2 comments

Can you please help me resolve this issue on android? startPlayerFromStream with no sound on android, same code works on IOS and Web, and I can pleasestartPlayer and got sound on android. My code like this: _player.uint8ListSink!.add(chunk); ... await _player.startPlayerFromStream( codec: Codec.pcm16, numChannels: 1, sampleRate: 24000, bufferSize: 1024*1024,
interleaved: true
); ... buffered chunk will be added later by another thread( _player.uint8ListSink!.add(chunk);) Please advics

hellking888 avatar Aug 06 '25 15:08 hellking888

BufferSize: 1024*1024 is huge! You can try to omit this parameter and let Flutter Sound use the a default value.

Larpoux avatar Aug 06 '25 15:08 Larpoux

awesome! I change it back to 161024, and I can hear the sound. I change the buffer to 10241024 because some times the play may intermittently, then I thought it may cased by the buffer not enough, and then I increased it. Larpoux, Thank you for the quick reply1

hellking888 avatar Aug 06 '25 15:08 hellking888