Why my media can't play with AVFoundation?
-
27-06-2021 - |
Question
NSString *soundFileURL=[[NSBundle mainBundle]pathForResource:@"noise" ofType:@"wma"];
self.noise=[[AVAudioPlayer alloc]initWithContentsOfURL:[NSURL fileURLWithPath:soundFileURL] error:nil];
[self.noise play];
then the main.m have mistake. When I use short media about 1 sec it would work.
Solution
Because AVFoundation
can't play Windows Media audio (WMA). Convert your "noise" to a supported format, such as MP3 or AAC.
Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow