• 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: AudioConverterFillComplexBuffer for rate conversion?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: AudioConverterFillComplexBuffer for rate conversion?


  • Subject: Re: AudioConverterFillComplexBuffer for rate conversion?
  • From: Michael Thornburgh <email@hidden>
  • Date: Sun, 25 Apr 2004 15:56:56 -0700

it's not safe to write more data into audio buffers that you've passed into an AudioConverter from your AudioConverterComplexInputDataProc until your AudioConverterComplexInputDataProc has been called for more data, indicating the previous data has been consumed.

so if your program sequence is:

read some samples into aBuffer
call AudioConverterFillComplexBuffer()
yourAudioConverterComplexInputDataProc() called by ACFCB()
link aBuffer into ioData
write converted samples to a file
repeat

then you can get glitches, because the AudioConverter might not be entirely done with all of the samples from aBuffer before it's overwritten.

instead, make your program sequence be:

call AudioConverterFillComplexBuffer()
yourAudioConverterComplexInputDataProc() called by ACFCB()
read some samples into aBuffer
link aBuffer into ioData
write converted samples to a file
repeat

that way, you're not changing anything in aBuffer until you know the AudioConverter has used up the last sample from the previous fill.

-mike


On Apr 25, 2004, at 3:30 PM, Ev wrote:

I've started using AudioConverterFillComplexBuffer for rate conversion,
but I'm having some issues between buffers.

Obviously I don't convert the whole file in one go, I use buffers of a
good size, then pass them to AudioConverterFillComplexBuffer for
conversion, then write them to the file.

Passing a good test tone through seems to create a glitch at the
BEGINNING of each NEW buffer. You can hear the buffer beginnings in
this example:

http://www.audiofile-engineering.com/997Hz_-6_48k.aif

Is this an expected side effect of this technique? Is there something I
can do?


Ev
Technical Knowledge Officer
Head Programmer/Designer
Audiofile Engineering

http://www.audiofile-engineering.com/
_______________________________________________
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.


  • Follow-Ups:
    • Pure Java Midi I/O on Mac OS/X
      • From: "Bob Lang" <email@hidden>
References: 
 >AudioConverterFillComplexBuffer for rate conversion? (From: Ev <email@hidden>)

  • Prev by Date: AudioConverterFillComplexBuffer for rate conversion?
  • Next by Date: Pure Java Midi I/O on Mac OS/X
  • Previous by thread: AudioConverterFillComplexBuffer for rate conversion?
  • Next by thread: Pure Java Midi I/O on Mac OS/X
  • Index(es):
    • Date
    • Thread