Re: [Audacity-devel] 24 bit bug
A free multi-track audio editor and recorder
Brought to you by:
aosiniao
From: Markus M. <me...@me...> - 2003-05-25 20:43:59
|
Am Son, 2003-05-25 um 02.40 schrieb Tino Meinen: > This might be just me being stupid: > > 1. Start up audacity > 2. Generate silence > 3. Set sample format to 24 bit > 4. Set sample format to 32 bit > > What you get is white noise with the samples randomly being assinged to > 0 and 1. In SimpleBlockFile.cpp, line 260, it reads for( int i = 0; i < framesRead; i++ ) intPtr[i] = (unsigned int)intPtr[i]; This should be for( int i = 0; i < framesRead; i++ ) if (intPtr[i] < 0) intPtr[i] = (int)(((unsigned int)intPtr[i] >> 8) | 0xFF000000); else intPtr[i] = (unsigned int)intPtr[i] >> 8; !!! BUT ONLY FOR X86 MACHINES (I suppose). I can't test how this should be for machines with other byte orders. A simple and platform independent fix would be: for( int i = 0; i < framesRead; i++ ) intPtr[i] = intPtr[i] / 256; This is optimized to a shift operation anyway (at least on MS Visual C++). Markus |