You are absolutely right!

I made some errors in my code that worked under certain conditions.
I mistakenly concluded it was due to the difference between the compressed and 
non-compressed formats.
Once you shook that misconception, I was able to see my error.

Thank you for clearing that up,


W.

From: Matt Ingalls [mailto:[email protected]]
Sent: Monday, July 02, 2018 5:58 PM
To: Waverly Edwards <[email protected]>
Cc: CoreAudio <[email protected]>
Subject: Re: Decoding compressed audio to LPCM

I do exactly that (in Obj-C) with AAC files and the AVAudioPCMBuffer’s 
floatChannelData is indeed raw PCM data.



On Jul 2, 2018, at 1:36 PM, Waverly Edwards 
<[email protected]<mailto:[email protected]>> wrote:

Would someone provide guidance on how I can decompress M4A and AAC files into 
memory as raw LPCM.
I need to decompress M4A and AAC files, manipulate and recompress the files 
back to disk.
Writing data from LPCM to M4A or AAC is not a problem (except AAC file 
durations are always wrong but will play)

I can read .caf, .m4a, .aac files into the buffer using the below code but only 
the .caf files are actually raw and allow me to work directly with the buffer 
contents

let file = try? AVAudioFile(forReading: url)
let buffer = AVAudioPCMBuffer(pcmFormat: file!.processingFormat, frameCapacity: 
AVAudioFrameCount(file!.length))
do {
    try file!.read(into: buffer!)
} catch  {
// problem, do something
}

I  looked into AVAudioCompressedBuffer but I do not see how I get the data into 
this type of buffer and how to expand this into raw data for manipulation

If it matters, I am programming on OSX (Sierra).

Any advice?

Thank you,


W.
_______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      
([email protected]<mailto:[email protected]>)
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/coreaudio-api/matt%408dio.com<https://lists.apple.com/mailman/options/coreaudio-api/matt%408dio.com>

This email sent to [email protected]<mailto:[email protected]>

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Coreaudio-api mailing list      ([email protected])
Help/Unsubscribe/Update your Subscription:
https://lists.apple.com/mailman/options/coreaudio-api/archive%40mail-archive.com

This email sent to [email protected]

Reply via email to