From 6997bb110470610ef749c28b7cc1d83c345bcd6e Mon Sep 17 00:00:00 2001 From: ExceptNullpointer Date: Sun, 31 Jan 2021 13:12:10 +0300 Subject: [PATCH] Fixed compilation issue --- .../progressia/client/audio/backend/SoundType.java | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/src/main/java/ru/windcorp/progressia/client/audio/backend/SoundType.java b/src/main/java/ru/windcorp/progressia/client/audio/backend/SoundType.java index 92bd133..72b1219 100644 --- a/src/main/java/ru/windcorp/progressia/client/audio/backend/SoundType.java +++ b/src/main/java/ru/windcorp/progressia/client/audio/backend/SoundType.java @@ -29,6 +29,7 @@ public class SoundType extends Namespaced { private int sampleRate; private int format; private int audioBuffer; + private int timeLength; public SoundType( String id, @@ -46,9 +47,14 @@ public class SoundType extends Namespaced { private void createAudioBuffer() { this.audioBuffer = alGenBuffers(); alBufferData(audioBuffer, format, rawAudio, sampleRate); + timeLength = rawAudio.limit() / sampleRate; } public void initSpeaker(Speaker speaker) { speaker.setAudioData(audioBuffer); } -} + + public int getTimeLength() { + return timeLength; + } +} \ No newline at end of file