ap4y / OrigamiEngine

Lightweight audio engine for iOS and OSX with flac, cue, mp3, m4a, m3u support.
http://ap4y.github.com/OrigamiEngine/
MIT License
545 stars 118 forks source link

Doesn't work with files from bundle #65

Open gerchicov-bp opened 9 years ago

gerchicov-bp commented 9 years ago

I added a file "flac" to the xcode project. I can play this file when It is stored anywhere else (for example in documents folder) but not from the app bundle

ap4y commented 9 years ago

Technically playing from the app bundle shouldn't be much different from any other path. I would suggest checking url format.

gerchicov-bp commented 9 years ago

Finally found the solution:

NSString *temp = [[NSBundle mainBundle] pathForResource:@"Fergalicious" ofType:@"flac"]; temp = [@"file://localhost" stringByAppendingString:temp]; temp = [temp stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];