From 481c17945a3cd0c6d6c71642145c69622396dece Mon Sep 17 00:00:00 2001 From: cosmonaut Date: Wed, 20 Jan 2021 11:03:26 -0800 Subject: [PATCH] fix static sound length --- src/Audio/StaticSound.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Audio/StaticSound.cs b/src/Audio/StaticSound.cs index 77802cd..1807e77 100644 --- a/src/Audio/StaticSound.cs +++ b/src/Audio/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(