If I call [AVAudioPlayerNode scheduleFile] with atTime = nil, my sound plays very nicely but only after all other sounds have finished playing.
This is inappropriate for the project I'm working on, I need sound effects to be able to play simultaneously.
So now I'm calling scheduleFile to play a sound with atTime = mach.absolute.time(). (Underscores instead of dots.)
The problem is, the beginnings of the sounds are often clipped, because presumably it takes a fraction of a second to copy the sound to the output buffer.
So I guess I could add an arbitrary delay to when I want the sound to play, but that's very hacky.
Is there a way to tell scheduleFile, "play the entire sound as soon as you're ready to play it, even if other sounds are playing simultaneously."
Thanks in advance!
This is inappropriate for the project I'm working on, I need sound effects to be able to play simultaneously.
So now I'm calling scheduleFile to play a sound with atTime = mach.absolute.time(). (Underscores instead of dots.)
The problem is, the beginnings of the sounds are often clipped, because presumably it takes a fraction of a second to copy the sound to the output buffer.
So I guess I could add an arbitrary delay to when I want the sound to play, but that's very hacky.
Is there a way to tell scheduleFile, "play the entire sound as soon as you're ready to play it, even if other sounds are playing simultaneously."
Thanks in advance!