From 6524fe8518c602fb98ef09c14c7d641933c83892 Mon Sep 17 00:00:00 2001 From: Lonami Exo Date: Wed, 1 Feb 2017 11:16:26 +0100 Subject: [PATCH] Fix sound bug (maybe) --- core/src/io/github/lonamiwebs/klooni/game/Board.java | 5 ++--- core/src/io/github/lonamiwebs/klooni/game/PieceHolder.java | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/core/src/io/github/lonamiwebs/klooni/game/Board.java b/core/src/io/github/lonamiwebs/klooni/game/Board.java index ca17451..b802c94 100644 --- a/core/src/io/github/lonamiwebs/klooni/game/Board.java +++ b/core/src/io/github/lonamiwebs/klooni/game/Board.java @@ -178,10 +178,9 @@ public class Board { } if (Klooni.soundsEnabled()) { - long id = stripClearSound.play(); pan = MathUtils.clamp(pan, -1, 1); - stripClearSound.setPitch(id, MathUtils.random(0.8f, 1.2f)); - stripClearSound.setPan(id, pan, MathUtils.random(0.7f, 1f)); + stripClearSound.play( + MathUtils.random(0.7f, 1f), MathUtils.random(0.8f, 1.2f), pan); } } diff --git a/core/src/io/github/lonamiwebs/klooni/game/PieceHolder.java b/core/src/io/github/lonamiwebs/klooni/game/PieceHolder.java index e1a84a7..2e0cd12 100644 --- a/core/src/io/github/lonamiwebs/klooni/game/PieceHolder.java +++ b/core/src/io/github/lonamiwebs/klooni/game/PieceHolder.java @@ -110,7 +110,7 @@ public class PieceHolder { } if (Klooni.soundsEnabled()) { // Random pitch so it's not always the same sound - takePiecesSound.setPitch(takePiecesSound.play(), MathUtils.random(0.8f, 1.2f)); + takePiecesSound.play(1, MathUtils.random(0.8f, 1.2f), 0); } } @@ -159,7 +159,7 @@ public class PieceHolder { // The larger the piece size, the smaller the pitch // Considering 10 cells to be the largest, 1.1 highest pitch, 0.7 lowest float pitch = 1.104f - pieces[heldPiece].calculateArea() * 0.04f; - pieceDropSound.setPitch(pieceDropSound.play(), pitch); + pieceDropSound.play(1, pitch, 0); } pieces[heldPiece] = null; } else {