Skip to content

Commit 82f23e2

Browse files
committed
Made AudioMixer the default sound system
1 parent 50df6b1 commit 82f23e2

File tree

2 files changed

+11
-15
lines changed

2 files changed

+11
-15
lines changed

build.gradle

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,11 @@ configurations {
2121

2222
repositories {
2323
mavenCentral()
24-
maven {
25-
name = "Lenni0451"
26-
url = "https://maven.lenni0451.net/everything"
27-
}
2824
}
2925

3026
dependencies {
31-
include "net.raphimc:NoteBlockLib:2.1.4-SNAPSHOT"
32-
include "net.raphimc:audio-mixer:2.0.0-SNAPSHOT"
27+
include "net.raphimc:NoteBlockLib:2.1.4"
28+
include "net.raphimc:audio-mixer:2.0.0"
3329
include "org.jcraft:jorbis:0.0.17"
3430
include "com.formdev:flatlaf:3.5.4"
3531
include "net.lenni0451.commons:swing:1.6.1"

src/main/java/net/raphimc/noteblocktool/frames/SongPlayerFrame.java

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,7 +85,7 @@ public static void close() {
8585
private final ListFrame.LoadedSong song;
8686
private final MonitoringSongPlayer songPlayer;
8787
private final Timer updateTimer;
88-
private final JComboBox<String> soundSystemComboBox = new JComboBox<>(new String[]{"OpenAL (best sound quality)", "Un4seen BASS", "AudioMixer (best system compatibility)", "AudioMixer multithreaded (experimental)", "XAudio2 (Windows 10+ only)"});
88+
private final JComboBox<String> soundSystemComboBox = new JComboBox<>(new String[]{"AudioMixer", "OpenAL", "Un4seen BASS", "AudioMixer multithreaded (experimental)", "XAudio2 (Windows 10+ only)"});
8989
private final JSpinner maxSoundsSpinner = new JSpinner(new SpinnerNumberModel(256, 64, 40960, 64));
9090
private final JSlider volumeSlider = new JSlider(0, 100, 50);
9191
private final JButton playStopButton = new JButton("Play");
@@ -249,13 +249,13 @@ private void initComponents() {
249249

250250
private boolean initSoundSystem() {
251251
final int currentIndex;
252-
if (this.soundSystem instanceof OpenALSoundSystem) {
253-
currentIndex = 0;
254-
} else if (this.soundSystem instanceof BassSoundSystem) {
255-
currentIndex = 1;
256-
} else if (this.soundSystem instanceof MultithreadedAudioMixerSoundSystem) {
252+
if (this.soundSystem instanceof MultithreadedAudioMixerSoundSystem) {
257253
currentIndex = 3;
258254
} else if (this.soundSystem instanceof AudioMixerSoundSystem) {
255+
currentIndex = 0;
256+
} else if (this.soundSystem instanceof OpenALSoundSystem) {
257+
currentIndex = 1;
258+
} else if (this.soundSystem instanceof BassSoundSystem) {
259259
currentIndex = 2;
260260
} else if (this.soundSystem instanceof XAudio2SoundSystem) {
261261
currentIndex = 4;
@@ -273,11 +273,11 @@ private boolean initSoundSystem() {
273273
final int maxSounds = ((Number) this.maxSoundsSpinner.getValue()).intValue();
274274

275275
if (this.soundSystemComboBox.getSelectedIndex() == 0) {
276-
this.soundSystem = OpenALSoundSystem.createPlayback(soundData, maxSounds);
276+
this.soundSystem = new AudioMixerSoundSystem(soundData, maxSounds, this.songPlayer.getSongView().getSpeed());
277277
} else if (this.soundSystemComboBox.getSelectedIndex() == 1) {
278-
this.soundSystem = BassSoundSystem.createPlayback(soundData, maxSounds);
278+
this.soundSystem = OpenALSoundSystem.createPlayback(soundData, maxSounds);
279279
} else if (this.soundSystemComboBox.getSelectedIndex() == 2) {
280-
this.soundSystem = new AudioMixerSoundSystem(soundData, maxSounds, this.songPlayer.getSongView().getSpeed());
280+
this.soundSystem = BassSoundSystem.createPlayback(soundData, maxSounds);
281281
} else if (this.soundSystemComboBox.getSelectedIndex() == 3) {
282282
this.soundSystem = new MultithreadedAudioMixerSoundSystem(soundData, maxSounds, this.songPlayer.getSongView().getSpeed());
283283
} else if (this.soundSystemComboBox.getSelectedIndex() == 4) {

0 commit comments

Comments
 (0)