Well, I spent some time studying the problem and realized that this question contains too little information to answer =) Thus, the deal is concluded:
Firstly, about the unmoved ones: At first I thought that it would look like this: l1 l2 l3 l4 ... ln r1 r2 r3 r4 ... rn But it turned out that the right channel was simply absent in my data. It turned out that this is not non-moving data, it is just simple monophonic data. And yes, it should always be multiple buffers if the data is not actually interleaved. If it alternates, it should be l1 r1 l2 r2 l3 r3 l4 r4 ...
Secondly, about the actual transformation: it all depends on the range of samples. In my case (and in any case, when the main sound is activated, if I'm right), fixed-point 8.24 values ββshould be in the range between (-1, 1), and 16-bit signed values ββshould be in the range between (-32768 , 32767). Thus, a value of 8.24 will always have the first 8 bits, either 0 (in the case of a positive) or 1 (in the case of a negative value). These first 8 bits must be removed (keeping the c sign). In addition, you can remove as many bits as you want - it will simply reduce the sound quality, but it will not ruin the sound. In the case of conversion to 16-bit format, bit 8-22 (15 bits) will actually contain the data that we must use for SInt16. Bit 7 can be used as a sign bit. Therefore, to convert 8.24 to SInt16, you just need to shift 9 bits to the right (9, because you need to keep the character) and transfer to SInt16
11111111 10110110 11101110 10000011 β 11111111 11111111 (11011011 01110111)
00000000 01101111 00000000 11000001 β 00000000 00000000 (00110111 10000000)
What is it. Nothing more than repeating through an array and shifting bits to the right. I hope that he will save someone a couple of hours.
Alexey
source share