• 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: Sample rate change
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Sample rate change


  • Subject: Re: Sample rate change
  • From: Mark Pauley <email@hidden>
  • Date: Mon, 27 Aug 2007 11:05:04 -0700

I'm positive that there's no easy way to solve your problem in the general case, but if you're guaranteed to be using LPCM where there is a constant input / output ratio for the converter then you could probably get away with creating a new converter in the actual render callback, disposing the old one, and then just calling invoking convert from there.
The only real problem would be if there is some sort of state you could be losing in the converter. If you're switching back and forth a bunch (or you know which rates you will switch to ahead of time) then I'd recommend creating all of the converters up front and invoking which ever one you need during the render callback.



_Mark

On Aug 26, 2007, at 2:34 PM, Andreas Falkenhahn wrote:


Hi,

how could I change the sample rate of a sound while it is playing on a mixer
bus? I saw in the includes that the 3DMixer supports a parameter to change
the sample rate on the fly, but I'm currently using the StereoMixer because I
don't need the 3D stuff. I'm already doing sample rate conversion in the
StereoMixer using an audio converter in my render proc, but how should I
change the sample rate of a playing sample? This would require a new
audio converter AFAICS!


So the only idea that comes to my mind is to stop the render proc on that
bus, dispose of the old audio converter, create a new audio converter with
the new sample rate, and restart the render proc on the required bus. I
haven't tried this approach yet, but I could imagine that it would cause a
certain crack to be audible, because I'm temporarily stopping playback.


So I'm wondering what I should do? Should I go with this approach, or
is there a better one? Or should I abandon the StereoMixer completely
and go with the 3DMixer which seems to support sample rate change
on the fly?

Tks for any opinions

Andreas

_______________________________________________
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

_______________________________________________ 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: 
 >Sample rate change (From: "Andreas Falkenhahn" <email@hidden>)

  • Prev by Date: Re: Playing multiple sounds
  • Next by Date: Re: AudioConverterNew() failure
  • Previous by thread: Sample rate change
  • Next by thread: Re: Sample rate change
  • Index(es):
    • Date
    • Thread