mackron / miniaudio

Audio playback and capture library written in C, in a single source file.
https://miniaud.io
Other
4.07k stars 361 forks source link

ma_audio_buffer looping issue #442

Closed nimetu closed 2 years ago

nimetu commented 2 years ago

I have crackling issue using ma_audio_buffer with loop=true.

I think pFramesOut in ma_audio_buffer_ref_read_pcm_frames() should be advanced when loop=true.

quetzalsly commented 2 years ago

I have a similar issue, didnt want to open a new issue in case its the same as this one. I am using the easy setup of miniaudio and calling my own play() quite a lot, quite fast but not every frame, only when a new thing is displayed on screen. inside my play() I have ma_sound_seek_to_pcm_frame(sound, 0); it results in the correct sound being repeated but it seems to crackle. Just playing the sound once normally without ma_sound_seek_to_pcm_frame does not produce a crackle.

mackron commented 2 years ago

Thanks for the reports. I'll be taking a look at this as soon as I get a chance.

mackron commented 2 years ago

@nimetu Sorry for the delay in getting this one fixed. That should be fixed in the dev branch if you want to give that a try.

@quetzalsly I think yours is a separate issue. I've created a separate issue for this one and will have some follow up questions for you: https://github.com/mackron/miniaudio/issues/449

nimetu commented 2 years ago

@nimetu Sorry for the delay in getting this one fixed. That should be fixed in the dev branch if you want to give that a try.

Thanks, I have same change in my local copy and it does fix the issue.