• 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: iPhone Audio Woes
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: iPhone Audio Woes


  • Subject: Re: iPhone Audio Woes
  • From: William Stewart <email@hidden>
  • Date: Mon, 30 Mar 2009 19:17:02 -0700


On Mar 30, 2009, at 5:38 AM, Timothy Larkin wrote:

My application uses the power applied the microphone to adjust the volume of playback, similar to Ocarina.

I have tried two solutions, both of which work to some degree, but each with a different problem.

In solution A, I use the remote i/o unit. A render callback reads data from an audio file.

you can't do this - the thread that your remote i/o unit is being called on is a thread which has time constraints, and reading files can be unbounded and blocking actions...


So, you'd have to read a file from another thread - and really the best way to do this is to use audio queues (unless you want to do the threading yourself, which is possible of course)


At the same time, I have an audio queue set up as a recorder. From this I periodically read the audio levels, which vary as expected as I blow into the microphone, and use this value to set the kHALOutputParam_Volume. However, full volume is always produced, regardless of the parameter setting.

This parameter is not implemented for the rio unit

Audio queues have a volume as well, so that's another reason to use them :)

In solution B, I adopted a strategy I found on-line. I make a small audio graph consisting of the remote i/o unit and a multi-channel mixer. I feed the mixer from a callback, and vary its volume using kMultiChannelMixerParam_Volume. This also works, except the volume produced, which does vary, is very soft, even with the parameter set to 1.0, equivalent to the master volume control being set to a tenth or so of its full value.

I don't know why that would be - OpenAL basically sits on the same kind of structure as you describe here and the games are not soft. There must be something else going on here.


This still leaves you with the "can't read the file in the I/O Proc" problem however.

(Oh, and open al would also be another alternative if you wanted to do that)

Bill

_______________________________________________
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


References: 
 >iPhone Audio Woes (From: Timothy Larkin <email@hidden>)

  • Prev by Date: Re: Streaming audio to AU's buffer
  • Next by Date: Re: iPhone Audio Woes
  • Previous by thread: Re: iPhone Audio Woes
  • Next by thread: AudioToolbox: shift playback position
  • Index(es):
    • Date
    • Thread