• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Convert an in-memory AAC file to LPCM
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Convert an in-memory AAC file to LPCM


  • Subject: Re: Convert an in-memory AAC file to LPCM
  • From: Chris Adamson <email@hidden>
  • Date: Wed, 24 Sep 2014 15:45:31 -0400

Should work a lot like that example, except that in your case the callback function that provides the data to convert (MyAudioConverterCallback() in that example) would just be advancing a pointer through your NSData, rather than calling AudioFileReadPackets().

FWIW, I freaking hate Audio Converter Services, and when I've had to do this myself, I sometimes will just use an offline AudioQueue to do format conversions. It simplifies buffering and is more streaming-friendly.

Hope this helps.

—Chris

On Sep 24, 2014, at 3:33 PM, Richard <email@hidden> wrote:

I have an iOS app that receives an AAC file over the network into an NSData buffer, and I would like to convert the received file to LPCM.

I saw the example in chapter 6 of the Core audio book using the Audio File services API.  This does what I want except for one thing; it expects the AAC file data to be in a file.

I could possibly save the received AAC bytes that from the NSData object into a file and then use the example from the CoreAudio book. However, I would like to avoid that step as I really have no use for that file apart from that conversion. It seems like a waste and it would also increase the latency for the AAC to LPCM conversion.

When I looked at the Audio File Services document,

https://developer.apple.com/library/ios/documentation/MusicAudio/Reference/AudioFileConvertRef/index.html

I saw this line:

This document describes Audio File Services, a C programming interface that enables you to read or write a wide variety of audio data to or from disk or a memory buffer.

But when I looked at the documentation, the functions seems to require a file id. They appear to be memory to file or file to memory conversions, and not memory to memory (I know that you can do memory to memory conversions from one LPCM format to another, but that is not what I need).

Is there any way to do this conversion without using a file as a staging area?

Richard

Do not post admin requests to the list. They will be ignored. Coreaudio-api mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: This email sent to email@hidden
  • Follow-Ups:
    • Re: Convert an in-memory AAC file to LPCM
      • From: Richard <email@hidden>
References: 
 >Convert an in-memory AAC file to LPCM (From: Richard <email@hidden>)

  • Prev by Date: Convert an in-memory AAC file to LPCM
  • Next by Date: Re: Convert an in-memory AAC file to LPCM
  • Previous by thread: Convert an in-memory AAC file to LPCM
  • Next by thread: Re: Convert an in-memory AAC file to LPCM
  • Index(es):
    • Date
    • Thread