v0.9.4: added mp3 music for iOS
This commit is contained in:
@@ -23,6 +23,7 @@ package com.watabou.noosa.audio;
|
|||||||
|
|
||||||
import com.badlogic.gdx.Gdx;
|
import com.badlogic.gdx.Gdx;
|
||||||
import com.watabou.noosa.Game;
|
import com.watabou.noosa.Game;
|
||||||
|
import com.watabou.utils.DeviceCompat;
|
||||||
|
|
||||||
public enum Music {
|
public enum Music {
|
||||||
|
|
||||||
@@ -37,6 +38,11 @@ public enum Music {
|
|||||||
private float volume = 1f;
|
private float volume = 1f;
|
||||||
|
|
||||||
public synchronized void play( String assetName, boolean looping ) {
|
public synchronized void play( String assetName, boolean looping ) {
|
||||||
|
|
||||||
|
//iOS cannot play ogg, so we use an mp3 alternative instead
|
||||||
|
if (assetName != null && DeviceCompat.isiOS()){
|
||||||
|
assetName = assetName.replace(".ogg", ".mp3");
|
||||||
|
}
|
||||||
|
|
||||||
if (isPlaying() && lastPlayed != null && lastPlayed.equals( assetName )) {
|
if (isPlaying() && lastPlayed != null && lastPlayed.equals( assetName )) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Reference in New Issue
Block a user