On 08/03/17 19:57, fredvs wrote:
For a file created with a TFileStream of gcc but that will be used by a
program compiled with VS, you should
convert the data from little endian to native ordering (or reverse) with
something like:

        for i := 0 to nSamples-1 do
        b egin
          PCMIn[i] := (pcm_bytes[2*i+1] shl 8) or pcm_bytes[2*i];
        end;

And this the reason why, for storing data, they prefer to use integer 32 bit
(where it seams that all compilers use the same order).

This has nothing to do with C compilers or with 16 vs 32 bit numbers. At most, it will be different on little and big endian platforms, just like with FPC. However, there are both little and big endian PCM 16 bit formats.


Jonas
_______________________________________________
fpc-pascal maillist  -  fpc-pascal@lists.freepascal.org
http://lists.freepascal.org/cgi-bin/mailman/listinfo/fpc-pascal

Reply via email to