• 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: extaudiofileread stereo float (iOS)
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: extaudiofileread stereo float (iOS)


  • Subject: Re: extaudiofileread stereo float (iOS)
  • From: Michael Tyson <email@hidden>
  • Date: Thu, 23 Feb 2012 21:04:12 +0100

That's right - that's what noninterleaved means: Each channel is treated separately.

It can be a little confusing, because the AudioBufferList structure defines only a single AudioBuffer within it - you have to either allocate space for the buffer list + the extra buffer, or use a struct or something on the stack.

For example, to prepare an AudioBufferList on the stack, to receive kBufferSize floating-point, stereo, non-interleaved samples:

struct { AudioBufferList bufferList; AudioBuffer secondBuffer; } buffers;
buffers.bufferList.mNumberBuffers = 2;
for ( int i=0; i<buffers.bufferList.mNumberBuffers; i++ ) {
   buffers.bufferList.mBuffers[i].mNumberOfChannels = 1;
   buffers.bufferList.mBuffers[i].mDataByteSize = kBufferSize * sizeof(float);
   buffers.bufferList.mBuffers[i].mData = malloc(kBufferSize * sizeof(float));
}



-- 
Michael Tyson | atastypixel.com
A Tasty Pixel: App artisans

Latest news: Loopy HD wins 2nd place in the 2011 Best App Ever Awards for Best Musicians App!

Find us on Facebook, and Twitter
Subscribe to our newsletter

aim: mikerusselltyson
twitter: MichaelTyson

On 23 Feb 2012, at 18:06, Gregory Wieber wrote:

Thanks Michael,

Sure - I'll post it when I put together a more simple test app. 

Curious: were you reading the noninterleaved audio into two different buffers in a bufferlist? That's the thing I can't seem to find any examples of online. 

best,

Greg


On Thu, Feb 23, 2012 at 2:22 AM, Michael Tyson <email@hidden> wrote:


 _______________________________________________
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: extaudiofileread stereo float (iOS)
      • From: Gregory Wieber <email@hidden>
References: 
 >extaudiofileread stereo float (iOS) (From: Gregory Wieber <email@hidden>)
 >Re: extaudiofileread stereo float (iOS) (From: Michael Tyson <email@hidden>)
 >Re: extaudiofileread stereo float (iOS) (From: Gregory Wieber <email@hidden>)

  • Prev by Date: Re: Using bindings in AU Cocoa GUI?
  • Next by Date: Re: extaudiofileread stereo float (iOS)
  • Previous by thread: Re: extaudiofileread stereo float (iOS)
  • Next by thread: Re: extaudiofileread stereo float (iOS)
  • Index(es):
    • Date
    • Thread