• 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
Simple code to use an effect
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Simple code to use an effect


  • Subject: Simple code to use an effect
  • From: "Jean-Philippe Leblanc" <email@hidden>
  • Date: Sun, 17 Feb 2002 23:02:04 -0800

Hi,

I modified the DefaultOutput Unit sample code in order to add effect to the playback so I can test the ones I wrote (is there a simple app that would let me do that?) I don't think that I am too far away from having it working but it still doesn't playback after much efforts trying.

Original code is UsingAudioConverterNoAC.cpp (since I use default output 32-bit float stereo 44100.)

I added an effect au (matrix reverb).

I feed the matrix render function with the sin generator in 32-bit float format. I also setup the AudioStreamBasicDescription for the effect au (same as the output au.)

Then I do :

AudioUnitConnection theConnection;
theConnection.sourceAudioUnit = theEffectUnit;
theConnection.sourceOutputNumber = 0;
theConnection.destInputNumber = 0;

verify_noerr(AudioUnitSetProperty(theOutputUnit,
kAudioUnitProperty_MakeConnection,
kAudioUnitScope_Input,
0,
&theConnection,
sizeof(theConnection)));

Is that the way it should be? In particular, the scope is input, so I need to give a source, right? The command could have been clearer if it was given an sense of direction. Connection doesn't say much about the way of the stream. Just a suggestion.


What are the sourceOutput and destInput numbers representing? I can't find any relation anywhere to with these number used here. I must have looked a dozen times in the headers and the pdfs. If I use 1 instead of 0, then the effect won't be pulled. Why?

In order to find out if the filter gets pulled, I built the sample effect au in the SDK and put a debug statement in the process loop. I get there. But I still can not hear anything. However since I invoke start on the default output au only, it is pulling its source correctly or it wouldn't reach the breakpoint in the effect au. Right?

Is there an order to do things. Can I make the connection at anytime (as soon as I get two au refs) and then change the properties?

Recently, someone was asking what needed to be ehnanced regarding documents. May I suggest that the coreaudio.pdf gets more details about the Audio Units stuff. Right now, it's about the same as reading the headers. Actually, it is the comments in the headers.

About the coreaudio pdf, the AudioStream API is totally missing from the document too.

Thanks for your help.




_________________________________________________________________
MSN Photos is the easiest way to share and print your photos: http://photos.msn.com/support/worldwide.aspx
_______________________________________________
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:
    • Re: Simple code to use an effect
      • From: Chris Rogers <email@hidden>
  • Prev by Date: OT: Why iTunes takes so much proc power
  • Next by Date: Re: MIDI Sysex and more
  • Previous by thread: OT: Why iTunes takes so much proc power
  • Next by thread: Re: Simple code to use an effect
  • Index(es):
    • Date
    • Thread