Juan Salcedo
Juan Salcedo

Reputation: 11

Can I access/play the default audio files that come with iPhone?

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.

Upvotes: 1

Views: 976

Answers (1)

mahboudz
mahboudz

Reputation: 39376

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.

Upvotes: 3

Related Questions