Merge branch 'dev_robotaxi-d_231206_6.2.4' into 'dev_robotaxi-d_231206_6.2.4_video_refactor'

Dev robotaxi d 231206 6.2.4

See merge request SCA/L4HA/AndroidApp/MoGoEagleEye!844
This commit is contained in:
aibingbing
2023-12-18 07:34:47 +00:00
9 changed files with 46 additions and 13 deletions

View File

@@ -4,6 +4,7 @@ import android.annotation.SuppressLint;
import android.media.*;
import android.content.*;
import android.app.*;
import android.util.Log;
public class SoundPoolHelper {
private SoundPool mSoundPool;
@@ -38,7 +39,9 @@ public class SoundPoolHelper {
//init settings
private void init(){
// AudioManager audio settings for adjusting the volume
mAudioManager = (AudioManager)this.mContext. getSystemService(Context.AUDIO_SERVICE);
if(mAudioManager == null){
mAudioManager = (AudioManager)this.mContext. getSystemService(Context.AUDIO_SERVICE);
}
// Current volumn Index of particular stream type.
float currentVolumeIndex = (float) mAudioManager.getStreamVolume(streamType);
@@ -87,6 +90,10 @@ public class SoundPoolHelper {
//play the sound res
private void playSound(){
if(mSoundPool == null){
Log.e("SoundPoolHelper","playSound mSoundPool is null");
return;
}
float leftVolume = volume;
float rightVolume = volume;
// Play sound of gunfire. Returns the ID of the new stream.