[n00b]Audio Graph AUConverter : stereo -> mono and resampling

Discussion in 'Mac Programming' started by Palad1, Sep 3, 2008.

  1. Palad1 macrumors 6502a


    Feb 24, 2004
    London, UK

    I'm writing my first audio graph and I'm entering a world of undocumented pain :eek:

    I want to use the audio graph to convert any file [ie. mp3/aac/aiff] to linearpcm float mono 44100hz, and then do some weird stuff with it.

    So I have set-up a graph, added the AUConverter, set its input SoundFormat property to match the file I want to convert, set the input callback, so far so good.

    1/ how can I instruct AUConverter to output a mono stream?

    2/ In my input callback, can I send the raw file as read from disk? Won't the ID3 tags/comments wreck havoc on my graph?

    3/ If I register a RenderCallback on the AUConverter node, will I be able to change what's being sent to the next node? I don't really wish to create my custom audio unit for what I'm going to do.

    4/ How does the threading work? Is the input callback going to be called when the output buffer runs out? I'm using AudioQueue to prime 16 buffers so I have continuous playback, how could this translate in this graph? I don't see anything about buffering data...

    5/ Thanks :)

Share This Page