ap4y/OrigamiEngine

Doesn't work with files from bundle

gerchicov-bp opened this issue · 2 comments

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

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

Finally found the solution:

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