From db7e63b11ad0fa8de786fe272381d439c25c808d Mon Sep 17 00:00:00 2001 From: Sebastian Kacza Date: Wed, 6 Jan 2021 11:27:47 +0100 Subject: [PATCH] =?UTF-8?q?Thread=20Test=20f=C3=BCr=20Audio=20hinzugef?= =?UTF-8?q?=C3=BCgt?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/de/jaujau/UnitTests/TEST_Audio.java | 5 +++-- src/de/jaujau/daten/Audio.java | 27 +++++++++++++++++++++++-- 2 files changed, 28 insertions(+), 4 deletions(-) diff --git a/src/de/jaujau/UnitTests/TEST_Audio.java b/src/de/jaujau/UnitTests/TEST_Audio.java index 375c273..bb72648 100755 --- a/src/de/jaujau/UnitTests/TEST_Audio.java +++ b/src/de/jaujau/UnitTests/TEST_Audio.java @@ -18,8 +18,9 @@ class TEST_Audio { @Test void test() { - sound.spieleJauJau(); - sound.spieleJau(); + //sound.spieleJauJau(); + //sound.spieleJau(); + sound.test(); } } diff --git a/src/de/jaujau/daten/Audio.java b/src/de/jaujau/daten/Audio.java index eebfd0d..b016dc2 100755 --- a/src/de/jaujau/daten/Audio.java +++ b/src/de/jaujau/daten/Audio.java @@ -14,9 +14,9 @@ import javax.sound.sampled.SourceDataLine; * */ public class Audio { - - public Audio() {} + public Audio() {} + /** * Spielt den "Jau" Ton ab @@ -41,6 +41,29 @@ public class Audio { } } + /** + * Spielt den "JauJau" Ton ab + */ + public void test() { + new Thread(new Runnable() { + @Override + public void run() { + try { + playSound("/sound/jaujau.wav"); + } catch (Exception e) { + // TODO Auto-generated catch block + e.printStackTrace(); + } + + } + + }).start(); + + for(int i = 0; i < 500000; i++) { + System.out.println(i); + } + } + /* * !!! DIESE METHODE IST NICHT VON MIR !!!