AVAudioPlayer initialization error
I initialize my AVAudioPlayer instance like:
[self.audioPlayer initWithContentsOfURL:url error:&err];
url contains the path of an .m4a file
The following error is displayed in the console when this line is called :”Error Domain=NSOSStatusErrorDomain Code=1685348671 “Operation could not be completed. (OSStatus error 1685348671.)“
What is the reason for this error?
Solutions Collect From Internet About “AVAudioPlayer initialization error”
The error code is a four-char-code for “dta?” (you can use the Calculator app in programmer mode to convert the int values to ASCII). Check the “result codes” of the various Core Audio references and you’ll find this is defined in both Audio File Services and Audio File Stream Services as
kAudioFileStreamError_InvalidFile respectively, both of which have the same definition:
The file is malformed, not a valid instance of an audio file of its type, or not recognized as an audio file. Available in iPhone OS 2.0 and later.
Have you tried your code with different .m4a files?
- Using Data in Rich Push notification on iOS with FCM
- Store userid in memory IOS
- What is the difference between a protocol and a interface in Objective-c?
- Making Core Data Thread-safe
- How to update Xcode to install “UNIX Development Support”?
- Download and execute iOS code dynamically at runtime
- Why does NSAssert break in main instead of in the code that call the assertion
- Dial number in iOS really need confirmation?
- Ambiguity with two inequality constraints
- UIPickerView: NSAttributedString not available in iOS 7?
- Replacement for stringByAddingPercentEscapesUsingEncoding in ios9?
- How to count occurrences of an element in a Swift array?
- Swift: Asynchronous callback
- Defining a “generic” segue in Interface Builder
- WKWebView did't give all cookies in navigationResponse