This is a simple example of playing an audio file from RubyMotion
The first step is to add AudioToolbox to the app.frameworks in Rakefile.
The audio is then played by getting the URL to the audio file within the resources folder using NSBundle.mainBundle.URLForResource:withExtension
and then passing that URL (which is compatible with CFURLRef) to AudioServicesCreateSystemSoundID
, dereferencing the Pointer passed in and passing that to AudioServicesPlaySystemSound
.