Skip to content

Commit 93a3732

Browse files
committed
fix typo. int -> float -> int conversion is now lossless
1 parent 9e1fc0a commit 93a3732

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

AudioConvert_F32.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ class AudioConvert_I16toF32 : public AudioStream_F32 //receive Int and transmits
3636

3737
static void convertAudio_I16toF32(audio_block_t *in, audio_block_f32_t *out, int len) {
3838
//WEA Method. Should look at CMSIS arm_q15_to_float instead: https://www.keil.com/pack/doc/CMSIS/DSP/html/group__q15__to__x.html#gaf8b0d2324de273fc430b0e61ad4e9eb2
39-
const float MAX_INT = 32678.0;
39+
const float MAX_INT = 32768.0;
4040
for (int i = 0; i < len; i++) out->data[i] = (float)(in->data[i]);
4141
arm_scale_f32(out->data, 1.0/MAX_INT, out->data, out->length); //divide by 32678 to get -1.0 to +1.0
4242
}
@@ -88,4 +88,4 @@ class AudioConvert_F32toI16 : public AudioStream_F32 //receive Float and transmi
8888

8989
};
9090

91-
#endif
91+
#endif

0 commit comments

Comments
 (0)