Skip to content

Commit d90981c

Browse files
committed
if you connect more than one input to the Jamulus input in the Jack routing, it can happen that the values are out of range {-1..1} and therefore we have to prevent bad clipping effects by using Float2Short
1 parent 6351776 commit d90981c

1 file changed

Lines changed: 2 additions & 5 deletions

File tree

linux/sound.cpp

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -259,11 +259,8 @@ int CSound::process ( jack_nframes_t nframes, void* arg )
259259
{
260260
for ( i = 0; i < pSound->iJACKBufferSizeMono; i++ )
261261
{
262-
pSound->vecsTmpAudioSndCrdStereo[2 * i] =
263-
(short) ( in_left[i] * _MAXSHORT );
264-
265-
pSound->vecsTmpAudioSndCrdStereo[2 * i + 1] =
266-
(short) ( in_right[i] * _MAXSHORT );
262+
pSound->vecsTmpAudioSndCrdStereo[2 * i] = Float2Short ( in_left[i] * _MAXSHORT );
263+
pSound->vecsTmpAudioSndCrdStereo[2 * i + 1] = Float2Short ( in_right[i] * _MAXSHORT );
267264
}
268265
}
269266

0 commit comments

Comments
 (0)