Ensure that audio is always 32-bit aligned

This commit is contained in:
Gwilym Kuiper 2021-10-26 22:14:14 +01:00
parent 4f0b01b932
commit 8a0bb13dba

View file

@ -66,9 +66,12 @@ pub fn include_wav(input: TokenStream) -> TokenStream {
let result = quote! {
{
#[repr(align(4))]
struct AlignmentWrapper<const N: usize>([u8; N]);
const _: &[u8] = include_bytes!(#include_path);
include_bytes!(#out_file_path_include)
&AlignmentWrapper(*include_bytes!(#out_file_path_include)).0
}
};