83 spelen van geluid geeft id terug (#86)

* Between commit

* Revert "Between commit"

This reverts commit 6c6e55492e.

* Removed debug print from main

* Removed class variables that are no longer used. Sound resources now generate a new Clip with the getNewClip() method.

* Successfully plays multiple instances of the same sound. Returns the clipID so the sound can be stopped.

* Added some comments
This commit is contained in:
Stef
2025-09-30 20:29:42 +02:00
committed by GitHub
parent db544868d9
commit a7cd0016f1
4 changed files with 69 additions and 69 deletions

View File

@@ -14,14 +14,17 @@ import java.io.IOException;
import java.nio.file.NotDirectoryException;
public class Main {
static void main(String[] args) throws IOException, UnsupportedAudioFileException, LineUnavailableException {
static void main(String[] args) throws IOException, UnsupportedAudioFileException, LineUnavailableException, InterruptedException {
var a = new AssetManager(new File("app/src/main/resources/assets"));
var b = new NetworkingClientManager();
var c = new SoundManager(a);
// IO.println(a.getAssets());
IO.println(c.getClips());
new EventFlow().addPostEvent(new AudioEvents.PlayAudio("mainmenu.wav", true)).asyncPostEvent();
new EventFlow().addPostEvent(new AudioEvents.PlayAudio("sadtrombone.wav", true)).asyncPostEvent();
Thread.sleep(200);
new EventFlow().addPostEvent(new AudioEvents.PlayAudio("mainmenu.wav", true)).asyncPostEvent();
new EventFlow().addPostEvent(new AudioEvents.PlayAudio("sadtrombone.wav", true)).asyncPostEvent();
Thread.sleep(200);
new EventFlow().addPostEvent(new AudioEvents.PlayAudio("mainmenu.wav", true)).asyncPostEvent();
new EventFlow().addPostEvent(new AudioEvents.PlayAudio("sadtrombone.wav", true)).asyncPostEvent();