I'm developing an app which has about 500 different short audio sounds, each has its own mp3 file. I'm using AVAudioPlayer to play them. The audios shouldn't be play simultaneously.
I thought of several options:
- Initializing 500 AVAudioPlayers objects, and when necessary call play() for the relevant object
- Holding 1 AVAudioPlayer, and change it to point to the relevant file as necessary. this require files name management that consumes 500 Strings and in runtime to initialize its resource path for reinitialization. (may be harder to debug)
- Holding 500 paths to resources (semi resource initialization) and 1 AVAudioPlayer that serves them all
What is the best practice for it?