Answered
0
0

I am facing limitations with FLAC files above 3000kbit/s. Is this a know issue?

  • You must to post comments
Best Answer
0
0
unsigned char* pcm24 = blah;
int byte = 0;
while (byte < length)
{
    int pcm32 = ((int)pcm24[byte]<<8 | (int)pcm24[byte+1]<<16 | (int)pcm24[byte+2]<<24) >> 8;
    byte += 3;
}
  • You must to post comments
0
0

Ok, I found that there is no issue about FLACs with this compression. In my code there is a problem with 24 bit data. Since I read by readData from a sound I have to interprete the data on my own.

Is this correct to read 24 bit to a 32 bit int:

casting the byte buffer to:
struct ThreeBytes {
unsigned char lowbyte;
unsigned char midbyte;
unsigned char highbyte;
};

ThreeBytes * buffer = (ThreeBytes *)&m_tempBuffer[0];

if( buffer[buffercounter].highbyte & 0x80 )
{
value = (0xff << 24)
| (buffer[buffercounter].highbyte << 8)
| (buffer[buffercounter].midbyte << 0);
| buffer[buffercounter].lowbyte;
}
else
{
value = (buffer[buffercounter].highbyte << 8)
| (buffer[buffercounter].midbyte << 0);
| buffer[buffercounter].lowbyte;
}

I am pretty unsure how to handle this correctly :( Any ideas?

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.