Quickly playing sound using OpenAL

Yes ! Usually iOS developer uses AVAudioPlayer to play sounds. But AVAudioPlayer takes time to load sound file for the first time.

Sugartin sound audio OpenAL

To load & play sound very quickly, one can go for OpenAL sound. So, here are the steps for that.

1) Create appropriate sound.

2) Import sound into your project.

3) Load the sound & Play.

1) To use OpenAL, It is recommended to use OpenAL. Convert your sound to CAF using following command in terminal.

It actually means, convert to Little-endian 16-bit format with 44100 sampling rate. ( I found this details from here, All credit goes to them. I posted it here just for keeping the notes. )

2) Open your project & Import the sound.

3) Put following line of code to load the sound.

4) Put following line to play the sound.

AudioServicesPlaySystemSound (soundID);

2 thoughts on “Quickly playing sound using OpenAL

  1. Hey! Someone in my Facebook group shared this site with us so I came to look it over. I’m definitely loving the information. I’m bookmarking and will be tweeting this to my followers! Wonderful blog and great style and design.

    • Thank you for visiting our site.

      But i think to do when ever twit over twitter that time please added ‘#’ and ‘@’ tag into twitter like ‘#sugartin’ and ‘@sugartininfo’

      we are also here for sharing more knowledge.

      For that upcoming post notification please subscribe to out site right hand site option.


Leave a Reply

Your email address will not be published. Required fields are marked *