AudioSource.PlayClipAtPoint causes noticeable lag in gameplay?

I have a side scroller where there is always constant movement of objects. When I do this
AudioSource.PlayClipAtPoint(ObjectPassing, Vector3 (240, 160, -300)); //stationary Main Camera position
The frame rate plummets and there is a huge lag every time.
I have a mp3 paying for background music, user can toggle it on and off but either way the PlayClipAtPoint lags.
The sound effects I’m trying to play are 30k mp3 files. Am I using the wrong formats, is there a better way to play repeating sound effects?

Thanks for any help!

It depends. If you checked “Decompress On Load”, then no. If you haven’t, then that’s your problem.

I’d recommend using an uncompressed format for short sound effects (WAV or AIFF).

So would I, but only when you have an uncompressed file to begin with. Otherwise, might as well keep the file size down, no?

But hey, I haven’t been able to build my game for months, so MikaMobile would know better how it works in practice. :stuck_out_tongue:

Thanks for the info. Using “Decompress on load” caused the app to crash. Using AIF files for the little sound effects works! :slight_smile: