Capture and Playback Needs to be "Primed" on Startup #633
-
I have been experimenting with your library using playback and capture for audio conferencing, thank you for your awesome work! I have my application to a point where I can consistently receive playback and also send microphone output to meeting api on Windows. One thing I have observed is that on startup of the audio, the user's audio will sound "choppy" until a long sound is processed using capture. Once the long sound (approx. 5 seconds) finishes, the audio quality greatly improves and there is no choppy audio unless a new session is started. I have a hunch that this is a buffer issue, but I wanted to check here first to get input. Here are some details:
Any comments/ideas? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
I'm not entire sure on the best way to avoid this to be honest. miniaudio is a fairly thin wrapper around the low level API. It just fires the data callback whenever the backend needs more data. It doesn't do any priming or anything. That said, it could just be a buggy duplex implementation on the part of miniaudio. Not entirely sure off the top of my head what would be causing it though. Sorry I can't be of more help with this one. All of your settings look totally fine. |
Beta Was this translation helpful? Give feedback.
-
Ok, let me try to decouple the mic and playback callbacks. I was only using duplex for diagnostics and ease of use. One thing I remember seeing in the miniaudio fprint log was that 3*480 buffers were going to be used under the hood. The output and input frames of 480 equal the number of frames the meeting is expecting. I am using these to hold my data/frames: |
Beta Was this translation helpful? Give feedback.
-
@mackron, I believe this priming behavior might be happening due to my implementation. Is there a way to make the MA callback function work in another class similar to virtual/override? Or does the MA callback need to be global? |
Beta Was this translation helpful? Give feedback.
@mackron, I believe this priming behavior might be happening due to my implementation. Is there a way to make the MA callback function work in another class similar to virtual/override? Or does the MA callback need to be global?