Noise in PlayBack
Noise in PlayBack
- Subject: Noise in PlayBack
- From: sheen mac <email@hidden>
- Date: Wed, 27 Dec 2006 08:34:09 -0800 (PST)
Hi All,
I am getting noise while playing the recorded data.I tried to set
some min value while playing.It reduced some noise.But till
noise is there.I enclosed the code here.
Waiting for your valuable suggestion.
Thanks in Advance,
Sheen
OSStatus playCallback(
AudioDeviceID device,
const AudioTimeStamp* now,
const AudioBufferList* input_data,
const AudioTimeStamp* input_time,
AudioBufferList*
output_data,
const AudioTimeStamp* output_time,
void* client_data
)
{
float* dst = NULL; // destination for the data
int num_of_units = 0; // number of sample points buffer can take
int num_to_play = 0; // number of sample units to play
int num_of_channels = output_data->mBuffers[0].mNumberChannels; // number of channels output supports
int i = 0; // index
int j = 0; // index into destination buffer.
// NSLog(@"Play");
int
channelcount=0;
int aftermul;
dst = (Float32*)(output_data->mBuffers[0].mData);
num_of_units = output_data->mBuffers[0].mDataByteSize / sizeof(Float32);
num_to_play = num_of_units / num_of_channels;
for (i = 0; i < num_to_play; i++) {
for (channelcount=0;channelcount < num_of_channels ; channelcount++) {
if(Pcms[Units_played] < 0)
{
if(Pcms[Units_played] < -0.020 )
dst[j++] = Pcms[Units_played];
else
dst[j++] =0.0;
}
if(Pcms[Units_played] >= 0.020 )
{
if(Pcms[Units_played] > 0.020 )
dst[j++] = Pcms[Units_played];
else
dst[j++] =0.0;
}
}
Units_played += 1;
}
return kAudioHardwareNoError;
}
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
_______________________________________________
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