문제

I've got an audio queue that I've got playing, stopping, pausing correctly but I'm finding the AudioQueueStop() function to be taking a long time to execute.

I'd like to immediately stop and then restart playing an audio queue and was wondering what the quickest way to do so would be.

In my project I have multiple audio queues that I keep around to play specific sounds over and over. There is a situation where I must stop some of those sounds and then immediately play them and many more at once. It isn't so bad if there are only a couple of audio queues that I do this to but it starts taking a long long time if there are many that I need to stop and restart.

I could fake it by calling stop on an audio queue and then creating a new one with the same sound but was wondering if there was a better way to do so.

도움이 되었습니까?

해결책

AudioQueue can be messy for that sort of stuff. It's difficult to stop the queue mid-buffer, and that means the current buffer will continue to play. Plus you have to deal with latency issues.

For fast stop and playback with low latency, I'd advise using the RemoteIO AudioUnit.

You can find a great tutorial with code here:

Using RemoteIO audio unit

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top