Skip to content

Commit

Permalink
Silence buffer before processing, fixes noise while rendering wav
Browse files Browse the repository at this point in the history
  • Loading branch information
falkTX committed Oct 29, 2013
1 parent 835f963 commit af044d9
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions release/distrib/replay/lib/sounddriver/sounddriver_linux.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,9 @@ static int jaudio_process_callback(jack_nframes_t nframes, void*)
float* audioBuf1 = (float*)jack_port_get_buffer(jaudio_port1, nframes);
float* audioBuf2 = (float*)jack_port_get_buffer(jaudio_port2, nframes);

memset(audioBuf1, 0, sizeof(float)*nframes);
memset(audioBuf2, 0, sizeof(float)*nframes);

AUDIO_Acknowledge = FALSE;

if (AUDIO_Play_Flag && (AUDIO_MixerFloat || AUDIO_Mixer))
Expand All @@ -75,7 +78,7 @@ static int jaudio_process_callback(jack_nframes_t nframes, void*)
AUDIO_MixerFloat(audioBuf1, audioBuf2, nframes);
}
else
{
{
Uint8 mixerBuf[nframes*2];
AUDIO_Mixer(mixerBuf, nframes*2);

Expand All @@ -88,8 +91,8 @@ static int jaudio_process_callback(jack_nframes_t nframes, void*)
}
else
{
for (jack_nframes_t i=0; i < nframes; ++i)
*audioBuf1++ = *audioBuf2++ = 0.0f;
//for (jack_nframes_t i=0; i < nframes; ++i)
// *audioBuf1++ = *audioBuf2++ = 0.0f;

AUDIO_Acknowledge = TRUE;
}
Expand Down

0 comments on commit af044d9

Please sign in to comment.