From e0b85180e6afb121acf460d015bd99d66b07a7e4 Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Wed, 20 Jan 2021 11:03:26 -0800 Subject: [PATCH] fix static sound length --- StaticSound.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/StaticSound.cs b/StaticSound.cs index 77802cd..1807e77 100644 --- a/StaticSound.cs +++ b/StaticSound.cs @@ -23,7 +23,7 @@ namespace MoonWorks.Audio throw new AudioLoadException("Error loading file!"); } var info = FAudio.stb_vorbis_get_info(filePointer); - var bufferSize = FAudio.stb_vorbis_stream_length_in_samples(filePointer); + var bufferSize = FAudio.stb_vorbis_stream_length_in_samples(filePointer) * info.channels; var buffer = new float[bufferSize]; FAudio.stb_vorbis_get_samples_float_interleaved(