Skip to content

Commit 1488bf0

Browse files
committed
Remove a misleading comment.
1 parent b221e13 commit 1488bf0

File tree

1 file changed

+1
-6
lines changed

1 file changed

+1
-6
lines changed

audio_jack.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -88,12 +88,7 @@ soxr_io_spec_t io_spec;
8888
#endif
8989

9090
static inline sample_t sample_conv(short sample) {
91-
// It sounds correct, but I don't understand it.
92-
// Zero int needs to be zero float. Check.
93-
// Plus 32767 int is 1.0. Check.
94-
// Minus 32767 int is -0.99997. And here my brain shuts down.
95-
// In my head, it should be 1.0, and we should tolerate an overflow
96-
// at minus 32768. But I'm sure there's a textbook explanation somewhere.
91+
// signed 16-bit int to float
9792
return ((sample < 0) ? (-1.0 * sample / SHRT_MIN) : (1.0 * sample / SHRT_MAX));
9893
}
9994

0 commit comments

Comments
 (0)