[fpc-pascal] Adding a array of float in ressource and use it ?
Jonas Maebe
jonas at freepascal.org
Wed Mar 8 20:01:19 CET 2017
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
More information about the fpc-pascal
mailing list