From 8a0bb13dbae87f566c262762ec1b102517aad3bd Mon Sep 17 00:00:00 2001 From: Gwilym Kuiper Date: Tue, 26 Oct 2021 22:14:14 +0100 Subject: [PATCH] Ensure that audio is always 32-bit aligned --- agb-sound-converter/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/agb-sound-converter/src/lib.rs b/agb-sound-converter/src/lib.rs index 4b6ddebf..c38efb79 100644 --- a/agb-sound-converter/src/lib.rs +++ b/agb-sound-converter/src/lib.rs @@ -66,9 +66,12 @@ pub fn include_wav(input: TokenStream) -> TokenStream { let result = quote! { { + #[repr(align(4))] + struct AlignmentWrapper([u8; N]); + const _: &[u8] = include_bytes!(#include_path); - include_bytes!(#out_file_path_include) + &AlignmentWrapper(*include_bytes!(#out_file_path_include)).0 } };