Skip to content

Commit 6a5d40a

Browse files
committed
fixed a typo int -> float -> int conversion is now lossless
credits to jcj83429, same as 93a3732
1 parent a609fa8 commit 6a5d40a

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

AudioConvert_F32.h

Lines changed: 1 addition & 1 deletion
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
}

0 commit comments

Comments
 (0)