Repository navigation
Replies: 3 comments 2 replies
|
The problem is that encoders can't necessarily deduce what the desired output format is based on the input format, and rather than guessing an error is thrown. For example, compressed audio typically has no bits per channel. When converting to PCM, what bits per channel value is desired by the caller? There is no way to know. For the Core Audio encoder there are many supported formats and the possibilities for matching input and output formats are numerous. With this in mind, the caller often needs to provide more information on what format is desired and the log states as much: To perform the conversion to AIFC it's necessary to set the format flags and bits per channel on the encoder: let encoder = try AudioEncoder(url: destURL, encoderName: .coreAudio)
encoder.settings = [
.coreAudioBitsPerChannel: 16,
.coreAudioFormatFlags: kAudioFormatFlagIsSignedInteger | kAudioFormatFlagIsBigEndian | kAudioFormatFlagIsPacked
]
let converter = try AudioConverter(url: url, encoder: encoder)
try converter.convert() |
|
The These are all the formats supported for either encoding or decoding. You can get a list of available formats for encoding using
So I don't believe AC-3 ( |
Uh oh!
There was an error while loading. Please reload this page.
Thank you for creating this beautiful library, It is really helpful for other developers.
I'm trying to convert an m4a file to some formats and but it is throwing me an error:-
Code I'm using:-
When I try to convert .m4a to .aifc I get
Same error I get with ac3 and eac3.
Any help will be truly appreciated.
All reactions