views:

147

answers:

1

In my app I want the user to choose (picker) what sound to play from the default audio files that come standard with the iPhone (Marimba, Alarm, etc...). And then play it when needed.

Thanks in advance!

+1  A: 

I found some sounds in this location:

/System/Library/Audio/UISounds/

You can load one this way:

tickSound = [[SoundEffect alloc] initWithContentsOfFile: @"/System/Library/Audio/UISounds/Tock.caf"];

Or get a list:

- (void) getSoundNames
{
    NSArray *array = [filemanager contentsOfDirectoryAtPath:@"/System/Library/Audio/UISounds/" error:nil];
    self.soundNamesArray = array;
}

Having said that, I am not sure if Apple approves of the use of these sounds.

mahboudz