6 #include "wave_ieee_float.h"
8 DEC_SETUPPROTO(SetupIEEE_Float
) {
9 struct WaveFormatEx
* fmt
;
11 if (fmt
->extraSize
!= 0)
13 switch (fmt
->bitsPerSample
) {
15 data
->Decode
= DecodeIEEE_Float_32
;
18 data
->Decode
= DecodeIEEE_Float_64
;
22 return DTERROR_UNKNOWN_COMPRESSION
;
24 data
->blockFrames
= 1;
28 DECODERPROTO(DecodeIEEE_Float_32
) {
30 for (frame
=0;frame
<numFrames
;frame
++) {
31 for (chan
=0;chan
<fmt
->numChannels
;chan
++) {
36 samp
.i
= read_le32(Src
); Src
+= 4;
37 *Dst
[chan
]++ = (BYTE
)(samp
.f
* 127.0);
43 DECODERPROTO(DecodeIEEE_Float_64
) {
45 for (frame
=0;frame
<numFrames
;frame
++) {
46 for (chan
=0;chan
<fmt
->numChannels
;chan
++) {
51 samp
.i
= read_le64(Src
); Src
+= 8;
52 *Dst
[chan
]++ = (BYTE
)(samp
.f
* 127.0);