AlvaroFranco / AFSoundManager

iOS audio playing (both local and streaming) and recording made easy
MIT License
807 stars 131 forks source link

Added designated initializer / detection of audio item type / gitignore #33

Closed Broich closed 7 years ago

Broich commented 9 years ago

Set the gitignore file to exclude all recommanded files/extensions according to https://github.com/github/gitignore/blob/master/Objective-C.gitignore

Broich commented 9 years ago

I thought it's a good idea to add a designated initializer to AFSoundItem. It just needs an NSURL to be passed in and is responsible for detecting the current state - AFSoundItemTypeLocal, AFSoundItemTypeStreaming, AFSoundItemTypeUnknown.

Hence you can init an AFSoundItem like this:

AFSoundItem *item1 = [[AFSoundItem alloc] initWithRessource:[[NSBundle mainBundle] URLForResource:@"demo1" withExtension:@"mp3"]];

and like this:

AFSoundItem *item1 = [[AFSoundItem alloc] initWithRessource:[NSURL URLWithString:@"http://path/to/file.mp3"]];

Let me know what you think?! :)

Broich commented 9 years ago

@AlvaroFranco What do you think about that pull request?