• 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: reading audiofile into floatbuffer
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: reading audiofile into floatbuffer


  • Subject: Re: reading audiofile into floatbuffer
  • From: Wesley Griffin <email@hidden>
  • Date: Fri, 16 Jan 2004 16:12:49 -0500

On Jan 16, 2004, at 3:07 PM, stiwi kirch wrote:

floatBuffer.mBuffers[0].mData = malloc(?); // how can i calculate the
memSize of one buffer?
This can be as large as you want. A 4K buffer would probably be good.

Thats exactly the part i don't understand! :( If i allocate a 4k buffer then it can only be used as a temp buffer for the AudioConverter to fill in 4k chunks of converted data. So i have to call AudioConverterFillComplexBuffer repeatedly until all the data is convert. AudioConverterFillComplexBuffer is using the same buffer over and over again. Right? But i need the converted data to be in one or two

Here's what I'm doing.

mBuffer is an AUBufferList which I'm using instead of a straight AudioBufferList struct.

Call AudioFileGetProperty for kAudioFilePropertyAudioDataByteCount.
Allocate a buffer with the returned size.
Call AudioFileReadPackets passing the newly allocated buffer.
Call mBuffer.Allocate() passing the number of packets read by AudioFileReadPackets.
Call mBuffer.PrepareBuffer()
Call AudioConverterFillComplexBuffer() passing &(mSampleBuffer.GetBufferList()) for the AudioBufferList.

This is working for me. It might not be the "approved" method, however...
_______________________________________________
coreaudio-api mailing list | email@hidden
Help/Unsubscribe/Archives: http://www.lists.apple.com/mailman/listinfo/coreaudio-api
Do not post admin requests to the list. They will be ignored.
References: 
 >reading audiofile into floatbuffer (From: stiwi <email@hidden>)
 >Re: reading audiofile into floatbuffer (From: stiwi kirch <email@hidden>)
 >Re: reading audiofile into floatbuffer (From: Robert Grant <email@hidden>)
 >Re: reading audiofile into floatbuffer (From: stiwi kirch <email@hidden>)

  • Prev by Date: test <eom>
  • Next by Date: Re: MatrixMixer live
  • Previous by thread: Re: reading audiofile into floatbuffer
  • Next by thread: Re: reading audiofile into floatbuffer
  • Index(es):
    • Date
    • Thread