When i call AudioOutputUnitStop, I hear an audible pop/click. Is there a way to prevent this? One solution I had in mind was to set a flag as soon as the user pauses. This flag would cause the audio to keep running but it would fade out. Then it would reset the playhead to 0.1s before where the audio was paused. Then, when the user hits play it would fade in in that tenth of a second. Is there an easier way?
EDIT: I ended up implementing what I suggested and it works fine though I changed the delay to 0.02s to make it less noticeable. I actually don't call AudioOutputUnitStop at all anymore but I just fill the buffer with 0's when the user hits pause. There's less lag this way when starting to play again.