Skip to content

Commit 7e2a962

Browse files
committed
Improve audio functions
1 parent 0acc827 commit 7e2a962

File tree

3 files changed

+0
-11
lines changed

3 files changed

+0
-11
lines changed

source/core/src/main/com/csse3200/game/components/audio/BackgroundMusicComponent.java

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,29 +24,25 @@ private void playMusic(String musicName) {
2424
if (ServiceLocator.getAudioService() != null) {
2525
ServiceLocator.getAudioService().playMusic(musicName, true);
2626
currentMusicName = musicName;
27-
logger.debug("Started playing music: {}", musicName);
2827
}
2928
}
3029

3130
private void stopMusic() {
3231
if (ServiceLocator.getAudioService() != null) {
3332
ServiceLocator.getAudioService().stopMusic();
3433
currentMusicName = null;
35-
logger.debug("Stopped music");
3634
}
3735
}
3836

3937
private void pauseMusic() {
4038
if (ServiceLocator.getAudioService() != null) {
4139
ServiceLocator.getAudioService().pauseMusic();
42-
logger.debug("Paused music");
4340
}
4441
}
4542

4643
private void resumeMusic() {
4744
if (ServiceLocator.getAudioService() != null) {
4845
ServiceLocator.getAudioService().resumeMusic();
49-
logger.debug("Resumed music");
5046
}
5147
}
5248

@@ -55,7 +51,6 @@ private void changeMusic(String newMusicName) {
5551
ServiceLocator.getAudioService().stopMusic();
5652
ServiceLocator.getAudioService().playMusic(newMusicName, true);
5753
currentMusicName = newMusicName;
58-
logger.debug("Changed music to: {}", newMusicName);
5954
}
6055
}
6156

source/core/src/main/com/csse3200/game/components/audio/SoundEffectComponent.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,14 +19,12 @@ public void create() {
1919
private void playSound(String soundName) {
2020
if (ServiceLocator.getAudioService() != null) {
2121
ServiceLocator.getAudioService().playSound(soundName);
22-
logger.debug("Playing sound: {}", soundName);
2322
}
2423
}
2524

2625
private void playSoundWithVolume(String soundName, Float volume) {
2726
if (ServiceLocator.getAudioService() != null) {
2827
ServiceLocator.getAudioService().playSound(soundName, volume);
29-
logger.debug("Playing sound: {} at volume {}", soundName, volume);
3028
}
3129
}
3230
}

source/core/src/main/com/csse3200/game/services/AudioService.java

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,13 +33,11 @@ private void loadSettings() {
3333
public void registerMusic(String name, String filepath) {
3434
Music music = ServiceLocator.getResourceService().getAsset(filepath, Music.class);
3535
musicMap.put(name, music);
36-
logger.debug("Registered music: {} -> {}", name, filepath);
3736
}
3837

3938
public void registerSound(String name, String filepath) {
4039
Sound sound = ServiceLocator.getResourceService().getAsset(filepath, Sound.class);
4140
soundMap.put(name, sound);
42-
logger.debug("Registered sound: {} -> {}", name, filepath);
4341
}
4442

4543
public void playMusic(String name, boolean loop) {
@@ -59,7 +57,6 @@ public void playMusic(String name, boolean loop) {
5957
currentMusic.setVolume(musicVolume);
6058
currentMusic.setLooping(loop);
6159
currentMusic.play();
62-
logger.debug("Playing music: {}", name);
6360
}
6461

6562
public void stopMusic() {
@@ -95,7 +92,6 @@ public void playSound(String name, float volume) {
9592
}
9693

9794
sound.play(volume);
98-
logger.debug("Playing sound: {} at volume {}", name, volume);
9995
}
10096

10197
public void setMusicVolume(float volume) {

0 commit comments

Comments
 (0)