Re: problem writing OS X audio driver
Re: problem writing OS X audio driver
- Subject: Re: problem writing OS X audio driver
- From: Doug Wyatt <email@hidden>
- Date: Thu, 20 Jun 2002 09:01:38 -0700
Are the applications you're testing with getting input from the Sound
Manager or directly from CoreAudio?
I saw this behavior with some Sound Manager apps many months ago and
didn't follow up on it, but when recording with CoreAudio I've not seen
this problem.
Doug
On Thursday, Jun 20, 2002, at 07:18 US/Pacific, Laurent Humbert wrote:
Hi everybody,
I got close but definitely no cigar with the audio driver I am working
on.
For the moment I kept things very simple with 1 single input
stream/channel.
Basically, everything works great, except the sound quality is really
bad. The music is recognizable, but it sounds extremely saturated. The
sound input level as displayed by audio recording software is normal
though.
I tried different input sources (iPod, Guitar, Mic...) but they all
sound real bad.
MyAudioEngine::convertInputSamples method looks like this:
IOReturn MyAudioEngine::convertInputSamples( const void *sampleBuf,
void *destBuf,
UInt32
firstSampleFrame,
UInt32
numSampleFrames,
const
IOAudioStreamFormat *streamFormat,
IOAudioStream
*audioStream)
{
UInt32 numSamplesLeft;
float *floatDestBuf;
SInt32 *inputBuf;
floatDestBuf = (float *) destBuf;
inputBuf = &(((SInt32 *)sampleBuf)[firstSampleFrame *
streamFormat->fNumChannels]);
numSamplesLeft = numSampleFrames * streamFormat->fNumChannels;
while (numSamplesLeft > 0)
{
// inputBuf points to a signed 24bit sample value coded on 32 bits,
like 0x00FFC935
*floatDestBuf = (*inputBuf << 8) / 2147483648.0;
// I have also tried converting the value to a SInt32 whilst
preserving the signed-ess
// and divide by 8388608.0 but the result is the same
++inputBuf;
++floatDestBuf;
--numSamplesLeft;
}
return kIOReturnSuccess;
}
Has anybody got an idea as to what might be going wrong ? I've been
trying to fix this one for days and I've run out of ideas.
Thanks
L
_______________________________________________
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.
--
Doug Wyatt
work: email@hidden (CoreAudio)
personal: email@hidden
http://www.sonosphere.com
"When you discard arrogance, complexity, and a few other things that
get in
the way, sooner or later you will discover that simple, childlike, and
mysterious secret known to those of the Uncarved Block: Life is Fun."
-- The Tao of Pooh
_______________________________________________
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.