Drop-in iOS Audio Player built on top of BASS-library.
.m4a, .mp3, .mp2, .mp1, .wave, .ogg, .wav, .aiff, .opus, .flac, *.wv. ... and even more I haven't tested.
- (BOOL)playItemWithURL:(NSURL *)url;
Get current track duration:
Get and set current track position:
/* Represents current position 0..1 */ @property (nonatomic, assign) CGFloat position;
Get and set volume:
//0..1 @property (nonatomic, assign) CGFloat volume;
/** * Notifies the delegate about playing status changed * * @param player APAudioPlayer */ - (void)playerDidChangePlayingStatus:(APAudioPlayer *)player; /** * Will be called when track is over * * @param player APAudioPlayer */ - (void)playerDidFinishPlaying:(APAudioPlayer *)player; /** * Will be called when interruption occured. For ex. phone call. Basically you should call - (void)pause in this case. * * @param player APAudioPlayer */ - (void)playerBeginInterruption:(APAudioPlayer *)player; /** * Will be called when interruption ended. For ex. phone call ended. It's up to you to decide to call - (void)resume or not. * * @param player APAudioPlayer * @param should BOOL */ - (void)playerEndInterruption:(APAudioPlayer *)player shouldResume:(BOOL)should;
//Somewhere during init self.player = [APAudioPlayer new]; //Somewhere else NSURL *fileURL = [[NSBundle mainBundle] URLForResource:@"Meat Loaf - Dead Ringer" withExtension:@"wv"]; [self.player playItemWithURL:fileURL];
Checkout Example folder.
BASS is an audio library for use in software on several platforms. Its purpose is to provide developers with powerful and efficient sample, stream (MP3, MP2, MP1, OGG, WAV, AIFF, custom generated, and more via OS codecs and add-ons), MOD music (XM, IT, S3M, MOD, MTM, UMX), MO3 music (MP3/OGG compressed MODs), and recording functions. All in a compact DLL that won't bloat your distribution.
If you have improvements or concerns, feel free to post an issue and write details.