• 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: Could someone correct my code, about a AUGraph, an audio file player and a multimode filter?
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Could someone correct my code, about a AUGraph, an audio file player and a multimode filter?


  • Subject: Re: Could someone correct my code, about a AUGraph, an audio file player and a multimode filter?
  • From: Robert Carroll <email@hidden>
  • Date: Sun, 11 May 2014 08:12:06 -0400

Hi Hervé,

So the two ways I know how to do that is to structure the audio graph either

fileplayerAU -- circularbuffer -- callback -- output

or skip the file player and read the source files into memory directly

readfilesto memorybuffer -- callback -- output

In my application, I was using several file players, but have switched to the 2nd of these options also to be able to access the audio data directly in the callback. I haven't tried the circular buffer approach. The circular buffer is documented in Chris Adamson's Core Audio book. There are examples of both approaches in the AudioGraph project.

Either way, the callback will read sequentially through all the frames pulled by the function and then write the modified samples to another buffer(s) for output passed on through the audio chain.

rob


On May 11, 2014, at 5:53 AM, herve.noury wrote:

Hi Robert,

I want to know how to get he audio input and to work with inside a AURenderCallback function. I try to do a filter to know how to do so. Then I'll do other things that the "standard" Audio Units of Mac OS can not do.

Thanks for the links you gave to me : I guess that the needed help is inside. I'm reading it actually, I'll test today.

Thanks for your help,

Best regards,

Hervé


Le 10 mai 2014 à 13:57, Robert Carroll <email@hidden> a écrit :

Hi Hervé,

You may get some other answers from the Core audio list, but it looks to me that you are setting up an AUGraph with the basic structure

FilePlayerAU -- LowPassFilterAU -- defaultOutputAU

The built in LowPassFilter will only get you these parameters:

// Parameters for the AULowpass unit
enum {
// Global, Hz, 10->(SampleRate/2), 6900
kLowPassParam_CutoffFrequency = 0,

// Global, dB, -20->40, 0
kLowPassParam_Resonance = 1
};

from AudioUnitParameters.h

If that is all you need, you don't need to do this in the callback, just make the connections and then manipulate the filter parameters.

On the other hand, to use the filter calculation you have in code, you don't need the effectAU, include the filter calculation in the callback (or in a branch of it) so that the samples you send to output have been updated depending on the filter effect.

You can feed the input of an AU with either a direction connection from another AUunit or with a callback, but its an either/or choice. 

There is a lot of useful code in Tom Zicarelli's Audiograph example on Github

https://github.com/tkzic/audiograph/blob/master/Classes/MixerHostAudio.m

It's set up for iOS, but mostly will work on Mac as well with minimal modification. It has been extremely helpful in trying to get my audio graph projects to run properly.

I've made a few small changes to your AudioManager code. Once its working here, I'll send it back to you.

regards,

rob


On May 9, 2014, at 11:07 AM, herve.noury wrote:

Hello Robert,

Thanks so much for mailing.

I send you with this mail the XCode project. The voids, graph, and so on are written, but I do not understand how to get the audio input to filter it in the AURenderCallback. Thanks for your help!

Best regards,

Hervé


<TestPlayerAndFilter.zip>



 _______________________________________________
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

  • Prev by Date: Re: Recording in MACE 3:1 and 6:1
  • Next by Date: iOS - Receiving MIDI Event from MusicPlayer
  • Previous by thread: Re: Could someone correct my code, about a AUGraph, an audio file player and a multimode filter?
  • Next by thread: Re: Recording in MACE 3:1 and 6:1
  • Index(es):
    • Date
    • Thread