Fixed compilation issue

This commit is contained in:
Евгений Смирнов 2021-01-31 13:12:10 +03:00
parent 127d1c3d87
commit 6997bb1104

View File

@ -29,6 +29,7 @@ public class SoundType extends Namespaced {
private int sampleRate; private int sampleRate;
private int format; private int format;
private int audioBuffer; private int audioBuffer;
private int timeLength;
public SoundType( public SoundType(
String id, String id,
@ -46,9 +47,14 @@ public class SoundType extends Namespaced {
private void createAudioBuffer() { private void createAudioBuffer() {
this.audioBuffer = alGenBuffers(); this.audioBuffer = alGenBuffers();
alBufferData(audioBuffer, format, rawAudio, sampleRate); alBufferData(audioBuffer, format, rawAudio, sampleRate);
timeLength = rawAudio.limit() / sampleRate;
} }
public void initSpeaker(Speaker speaker) { public void initSpeaker(Speaker speaker) {
speaker.setAudioData(audioBuffer); speaker.setAudioData(audioBuffer);
} }
}
public int getTimeLength() {
return timeLength;
}
}