float lpcm garbage problem
float lpcm garbage problem
- Subject: float lpcm garbage problem
- From: Nicolas Dangy-Caye <email@hidden>
- Date: Wed, 2 Feb 2005 20:37:18 +0100
Hi,
I'm trying to convert a VST I've developped into an Audio Unit and an OSX 'stand alone' version.
At this point, the Audiounit version is working fine but I've got problem with the standalone version.
I start from the Audiothru example as basis of the standalone version.
The format ID of the Audio stream I process is a 32bit float big endian lpcm.
I suspect a wrong conversion from the input stream byte buffer to the sampleR and sampleL float.
Can you tell me whether this conversion is accurate as I get a garbage in the data that I don't have in the Audio unit version ?
//call of the process in the standalone version
bool AudioRingBuffer::Store(const Byte *data, UInt32 nFrames, SInt64 startFrame)
{
....
mStandAloneVersion->Process ((const float *)data, nFrames);
....
}
// Input Stream Process from Standalone version.
void StandAloneVersion::Process (const float *data, int nFrames)
{
int i,s;
float sampleL, sampleR, sample;
for (i=0; i <nFrames; i+=2) {
sampleL = *(data + i);
sampleR = *(data + i+1);
// DSP Stuff
....
}
}
// Input Stream Process from AudioUnit version.
void AudioUnitVersion::AudioUnitVersionKernel::Process ( const Float32 *inSourceP,
Float32 *inDestP,
UInt32 inFramesToProcess,
UInt32 inNumChannels,
bool &ioSilence )
{
//This code will pass-thru the audio data.
//This is where you want to process data to produce an effect.
const Float32 *sourceP = inSourceP;
Float32 *destP = inDestP;
UInt32 s;
for (s=0; s<inFramesToProcess; s++) {
// get current sample and copy it into output
Float32 inputSample = *sourceP;
sourceP += inNumChannels;
Float32 outputSample = inputSample;
*destP = outputSample;
destP += inNumChannels;
// DSP Stuff
...
}
}
_______________________________________________
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