APAudioPlayer
Drop-in iOS Audio Player built on top of BASS-library.
Install / Use
/learn @Alterplay/APAudioPlayerREADME
#APAudioPlayer
<img src="https://dl.dropboxusercontent.com/u/2334198/APAudioPlayer-git-teaser.png">Drop-in iOS Audio Player built on top of BASS-library.
###Supported formats:
*.m4a, *.mp3, *.mp2, *.mp1, *.wave, *.ogg, *.wav, *.aiff, *.opus, *.flac, *.wv. ... and even more I haven't tested.
Dead-simple interface:
Play:
- (BOOL)playItemWithURL:(NSURL *)url;
Pause:
- (void)pause;
Resume:
- (void)resume;
Is playing?:
- (BOOL)isPlaying;
Get current track duration:
- (NSTimeInterval)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;
Dead-simple protocol:
/**
* 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;
Integration:
CocoaPods:
pod 'APAudioPlayer'
Manually:
- Drag-and-drop APAudioPlaeyr folder into your project.
- Add AVFoundation.framework to your project
- Instantiate APAudioPlayer and have fun:
//Somewhere during init
self.player = [APAudioPlayer new];
//Somewhere else
NSURL *fileURL = [[NSBundle mainBundle] URLForResource:@"Meat Loaf - Dead Ringer" withExtension:@"wv"];
[self.player playItemWithURL:fileURL];
Example:
Checkout Example folder.

BASS:
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.
http://www.un4seen.com
http://www.un4seen.com/bass.html#license
What's next?:
- Online streaming.
Contacts
If you have improvements or concerns, feel free to post an issue and write details.
Check out all Alterplay's GitHub projects. Email us with other ideas and projects.
Related Skills
node-connect
348.5kDiagnose OpenClaw node connection and pairing failures for Android, iOS, and macOS companion apps
frontend-design
109.1kCreate distinctive, production-grade frontend interfaces with high design quality. Use this skill when the user asks to build web components, pages, or applications. Generates creative, polished code that avoids generic AI aesthetics.
openai-whisper-api
348.5kTranscribe audio via OpenAI Audio Transcriptions API (Whisper).
qqbot-media
348.5kQQBot 富媒体收发能力。使用 <qqmedia> 标签,系统根据文件扩展名自动识别类型(图片/语音/视频/文件)。
