summaryrefslogtreecommitdiff
path: root/src/wav.c
diff options
context:
space:
mode:
authorsteven-na <noreply.github@stvnc.dev>2026-08-05 21:23:31 -0700
committersteven-na <noreply.github@stvnc.dev>2026-08-05 21:23:31 -0700
commit1646dfb9159e66c30821a5659e8f0a5eb3d52f05 (patch)
treef6d4b6a876af0d35af832e8cdc312ff8777f548c /src/wav.c
parente0e52953570caea66096cda08dc814f34735f7af (diff)
Formatting, bug fix, test coverage
Diffstat (limited to 'src/wav.c')
-rw-r--r--src/wav.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/wav.c b/src/wav.c
index ab8919d..e1e6e2c 100644
--- a/src/wav.c
+++ b/src/wav.c
@@ -254,9 +254,11 @@ f64 *read_32bps_float_data(smrt_arena_t *arena, wav_data_t data, u16 num_channel
u8 two = data.samples[(i*4*num_channels)+1+channel*4];
u8 three = data.samples[(i*4*num_channels)+2+channel*4];
u8 four = data.samples[(i*4*num_channels)+3+channel*4];
- u32 intermediate = one | two << 8 | three << 16 | four << 24;
+ u32 intermediate = one | two << 8 | three << 16 | (u32)four << 24;
- memcpy(&vs[i], &intermediate, sizeof(u32));
+ f32 f;
+ memcpy(&f, &intermediate, sizeof(f32));
+ vs[i] = (f64)f;
}
return vs;