Fix sound bug (maybe)

This commit is contained in:
Lonami Exo 2017-02-01 11:16:26 +01:00
parent 6a45790538
commit 6524fe8518
2 changed files with 4 additions and 5 deletions

View file

@ -178,10 +178,9 @@ public class Board {
} }
if (Klooni.soundsEnabled()) { if (Klooni.soundsEnabled()) {
long id = stripClearSound.play();
pan = MathUtils.clamp(pan, -1, 1); pan = MathUtils.clamp(pan, -1, 1);
stripClearSound.setPitch(id, MathUtils.random(0.8f, 1.2f)); stripClearSound.play(
stripClearSound.setPan(id, pan, MathUtils.random(0.7f, 1f)); MathUtils.random(0.7f, 1f), MathUtils.random(0.8f, 1.2f), pan);
} }
} }

View file

@ -110,7 +110,7 @@ public class PieceHolder {
} }
if (Klooni.soundsEnabled()) { if (Klooni.soundsEnabled()) {
// Random pitch so it's not always the same sound // 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 // The larger the piece size, the smaller the pitch
// Considering 10 cells to be the largest, 1.1 highest pitch, 0.7 lowest // Considering 10 cells to be the largest, 1.1 highest pitch, 0.7 lowest
float pitch = 1.104f - pieces[heldPiece].calculateArea() * 0.04f; float pitch = 1.104f - pieces[heldPiece].calculateArea() * 0.04f;
pieceDropSound.setPitch(pieceDropSound.play(), pitch); pieceDropSound.play(1, pitch, 0);
} }
pieces[heldPiece] = null; pieces[heldPiece] = null;
} else { } else {