• 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
sample rate conversion question
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

sample rate conversion question


  • Subject: sample rate conversion question
  • From: Stan Jou <email@hidden>
  • Date: Tue, 26 Oct 2004 00:09:51 -0400

Hi list friends,

I have some problem on sample rate conversion.
Could somebody please advise?

What I plan to write is a simple recorder program
dedicated to my own little use,
running on my 12" Powerbook running OS X 10.3.
The program should record from the line jack.

So far I've integrated the CoreAudio example 'afrecord'
with a simple Cocoa interface.
It works well on sample rate 44100.

Now I'm trying to incorporate sample rate conversion
to make the sample rate 8000.
So I add a SetClientFormat() call to afrecord.cpp:

		file.PrepareNew(dataFormat, 8000);
		dataFormat.mSampleRate = 44100;
		file.SetClientFormat(dataFormat);
		file.Create(recordFileName, kAudioFileAIFFType);

then I get a AudioUnitErr_CannotDoInCurrentContext = -10863.

How should I do it correctly?
Should I do it in another thread as suggested in TN2091?

Since this program should be really simple,
I'm also wondering if there is some easier way
other than writing Core Audio to do this?
I feel Core Audio might be too powerful for me to
do this simple task...  :-)

I also try to do it off-line, e.g.
'afrecord' then 'afconvert',
but I can't figure out the parameters to
make 'afconvert' work properly to do SRC.
Could somebody please help?

Thank you!
Stan.
 _______________________________________________
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

  • Follow-Ups:
    • Re: sample rate conversion question
      • From: Doug Wyatt <email@hidden>
  • Prev by Date: Re: Crash on CloseComponent
  • Next by Date: Re: basic output unit question - multichannel
  • Previous by thread: Re: basic output unit question - multichannel
  • Next by thread: Re: sample rate conversion question
  • Index(es):
    • Date
    • Thread