Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ of this software and associated documentation files (the "Software"), to deal
import android.speech.tts.TextToSpeech;
import android.util.Log;
import android.widget.Toast;
import android.media.AudioManager;

import com.maq.xprize.bali.db.entity.User;
import com.maq.xprize.bali.repo.UserRepo;
Expand Down Expand Up @@ -89,6 +90,7 @@ public class AppActivity extends Cocos2dxActivity {
private static Context _context;
private static String currentGameName;
private static boolean supportForTTSEnabled = false;
AudioManager audioManager;

static {
System.out.println("Loaded library");
Expand Down Expand Up @@ -390,6 +392,11 @@ public void onInit(int status) {
}
}
});
audioManager = (AudioManager) getSystemService(Context.AUDIO_SERVICE);
int maxVolume = audioManager.getStreamMaxVolume(AudioManager.STREAM_MUSIC); //maximum value of stream media.
if (audioManager.getStreamVolume(AudioManager.STREAM_MUSIC) < maxVolume / 2) { //check if the audio is less than 50%
audioManager.setStreamVolume(AudioManager.STREAM_MUSIC, maxVolume / 2, 0); //set the audio to 50% when app start.
}
}

private void needExtraction() {
Expand Down