开发者

Objective-C: AudioOutputUnitStart takes a long time to start. Possible workaround?

开发者 https://www.devze.com 2023-02-27 00:43 出处:网络
AudioOutputUnitStart function takes up to 1-2 seconds to start every time I call it. I use AudioOutputUnitStop to stop it, is there something like AudioOutputUnitPause so that it only takes this much

AudioOutputUnitStart function takes up to 1-2 seconds to start every time I call it. I use AudioOutputUnitStop to stop it, is there something like AudioOutputUnitPause so that it only takes this much to start first time? Or do I have to keep it all the time started and outp开发者_StackOverflowut silence when "stopped" (this doesn't seem right)

Thanks!

EDIT: The sound I play it's pretty short (under a second, streaming continuously ) so I don't think it's that, probably that's how much it usually takes no matter the sound size.


Try to decrease your buffer size for your audio data. iOS will not begin playing until the first buffer is filled with data. If this buffer size is quite big, it might take 1-2 seconds.

0

精彩评论

暂无评论...
验证码 换一张
取 消