¡@

Home 

2014/10/16 ¤W¤È 08:18:44

android Programming Glossary: maudiomanager

Android Speech Recognition as a service on Android 4.1 & 4.2

http://stackoverflow.com/questions/14940657/android-speech-recognition-as-a-service-on-android-4-1-4-2

class MyService extends Service protected AudioManager mAudioManager protected SpeechRecognizer mSpeechRecognizer protected Intent.. 2 @Override public void onCreate super.onCreate mAudioManager AudioManager getSystemService Context.AUDIO_SERVICE mSpeechRecognizer.. turn off beep sound target.mAudioManager.setStreamMute AudioManager.STREAM_SYSTEM true if target.mIsListening..

Using the Android RecognizerIntent with a bluetooth headset

http://stackoverflow.com/questions/14991158/using-the-android-recognizerintent-with-a-bluetooth-headset

BluetoothDevice mConnectedHeadset private AudioManager mAudioManager private boolean mIsCountDownOn private boolean mIsStarting private.. mBluetoothAdapter BluetoothAdapter.getDefaultAdapter mAudioManager AudioManager mContext.getSystemService Context.AUDIO_SERVICE.. 1 Device support bluetooth if mBluetoothAdapter null if mAudioManager.isBluetoothScoAvailableOffCall mContext.registerReceiver mBroadcastReceiver..

Control the default music player of android or any other music player

http://stackoverflow.com/questions/18800198/control-the-default-music-player-of-android-or-any-other-music-player

service share improve this question AudioManager mAudioManager AudioManager getSystemService Context.AUDIO_SERVICE if mAudioManager.isMusicActive.. AudioManager getSystemService Context.AUDIO_SERVICE if mAudioManager.isMusicActive Intent i new Intent SERVICECMD i.putExtra CMDNAME..

Playing multiple sounds using SoundManager

http://stackoverflow.com/questions/3039078/playing-multiple-sounds-using-soundmanager

HashMap Integer Integer mSoundPoolMap private AudioManager mAudioManager private Context mContext private Vector Integer mAvailibleSounds.. 0 mSoundPoolMap new HashMap Integer Integer mAudioManager AudioManager mContext.getSystemService Context.AUDIO_SERVICE.. if mAvailibleSounds.contains index int streamVolume mAudioManager.getStreamVolume AudioManager.STREAM_MUSIC int soundId mSoundPool.play..

Playing sounds simultaneously Android

http://stackoverflow.com/questions/5957444/playing-sounds-simultaneously-android

HashMap Integer Integer mSoundPoolMap private AudioManager mAudioManager private Context mContext public SoundManager Context theContext.. 0 mSoundPoolMap new HashMap Integer Integer mAudioManager AudioManager mContext.getSystemService Context.AUDIO_SERVICE.. 1 public void playSound int index float streamVolume mAudioManager.getStreamVolume AudioManager.STREAM_RING streamVolume streamVolume..

How to properly use SoundPool on a game?

http://stackoverflow.com/questions/7437505/how-to-properly-use-soundpool-on-a-game

the SoundPool initialization is done on the app startup mAudioManager AudioManager context.getSystemService Context.AUDIO_SERVICE..

Android: how to play music at maximum possible volume?

http://stackoverflow.com/questions/9599259/android-how-to-play-music-at-maximum-possible-volume

ogg clip public void playSound int index int streamVolume mAudioManager.getStreamVolume AudioManager.STREAM_MUSIC mSoundPool.play mSoundPoolMap.get.. and setStreamVolume to do this int origionalVolume mAudioManager.getStreamVolume AudioManager.STREAM_MUSIC mAudioManager.setStreamVolume.. mAudioManager.getStreamVolume AudioManager.STREAM_MUSIC mAudioManager.setStreamVolume AudioManager.STREAM_MUSIC mAudioManager.getStreamMaxVolume..

Android Speech Recognition as a service on Android 4.1 & 4.2

http://stackoverflow.com/questions/14940657/android-speech-recognition-as-a-service-on-android-4-1-4-2

This is a work around for android version 4.1.1. public class MyService extends Service protected AudioManager mAudioManager protected SpeechRecognizer mSpeechRecognizer protected Intent mSpeechRecognizerIntent protected final Messenger mServerMessenger.. 1 static final int MSG_RECOGNIZER_CANCEL 2 @Override public void onCreate super.onCreate mAudioManager AudioManager getSystemService Context.AUDIO_SERVICE mSpeechRecognizer SpeechRecognizer.createSpeechRecognizer this mSpeechRecognizer.setRecognitionListener.. MSG_RECOGNIZER_START_LISTENING if Build.VERSION.SDK_INT Build.VERSION_CODES.JELLY_BEAN turn off beep sound target.mAudioManager.setStreamMute AudioManager.STREAM_SYSTEM true if target.mIsListening target.mSpeechRecognizer.startListening target.mSpeechRecognizerIntent..

Using the Android RecognizerIntent with a bluetooth headset

http://stackoverflow.com/questions/14991158/using-the-android-recognizerintent-with-a-bluetooth-headset

private BluetoothHeadset mBluetoothHeadset private BluetoothDevice mConnectedHeadset private AudioManager mAudioManager private boolean mIsCountDownOn private boolean mIsStarting private boolean mIsOnHeadsetSco private boolean mIsStarted private.. public BluetoothHeadsetUtils Context context mContext context mBluetoothAdapter BluetoothAdapter.getDefaultAdapter mAudioManager AudioManager mContext.getSystemService Context.AUDIO_SERVICE Call this to start BluetoothHeadsetUtils functionalities... boolean startBluetooth Log.d TAG startBluetooth NON NLS 1 Device support bluetooth if mBluetoothAdapter null if mAudioManager.isBluetoothScoAvailableOffCall mContext.registerReceiver mBroadcastReceiver new IntentFilter BluetoothDevice.ACTION_ACL_CONNECTED..

Control the default music player of android or any other music player

http://stackoverflow.com/questions/18800198/control-the-default-music-player-of-android-or-any-other-music-player

market which controls the music player. Any idea android android service share improve this question AudioManager mAudioManager AudioManager getSystemService Context.AUDIO_SERVICE if mAudioManager.isMusicActive Intent i new Intent SERVICECMD i.putExtra.. share improve this question AudioManager mAudioManager AudioManager getSystemService Context.AUDIO_SERVICE if mAudioManager.isMusicActive Intent i new Intent SERVICECMD i.putExtra CMDNAME CMDSTOP YourApplicationClass.this.sendBroadcast i you can..

Playing multiple sounds using SoundManager

http://stackoverflow.com/questions/3039078/playing-multiple-sounds-using-soundmanager

kill queue myself. private SoundPool mSoundPool private HashMap Integer Integer mSoundPoolMap private AudioManager mAudioManager private Context mContext private Vector Integer mAvailibleSounds new Vector Integer private Vector Integer mKillSoundQueue.. mContext theContext mSoundPool new SoundPool 20 AudioManager.STREAM_MUSIC 0 mSoundPoolMap new HashMap Integer Integer mAudioManager AudioManager mContext.getSystemService Context.AUDIO_SERVICE public void addSound int Index int SoundID mAvailibleSounds.add.. void playSound int index dont have a sound for this obj return. if mAvailibleSounds.contains index int streamVolume mAudioManager.getStreamVolume AudioManager.STREAM_MUSIC int soundId mSoundPool.play mSoundPoolMap.get index streamVolume streamVolume..

Playing sounds simultaneously Android

http://stackoverflow.com/questions/5957444/playing-sounds-simultaneously-android

class SoundManager private SoundPool mSoundPool private HashMap Integer Integer mSoundPoolMap private AudioManager mAudioManager private Context mContext public SoundManager Context theContext mContext theContext mSoundPool new SoundPool 4 AudioManager.STREAM_MUSIC.. mContext theContext mSoundPool new SoundPool 4 AudioManager.STREAM_MUSIC 0 mSoundPoolMap new HashMap Integer Integer mAudioManager AudioManager mContext.getSystemService Context.AUDIO_SERVICE public void addSound int index int SoundID mSoundPoolMap.put.. SoundID mSoundPoolMap.put index mSoundPool.load mContext SoundID 1 public void playSound int index float streamVolume mAudioManager.getStreamVolume AudioManager.STREAM_RING streamVolume streamVolume mAudioManager.getStreamMaxVolume AudioManager.STREAM_RING..

How to properly use SoundPool on a game?

http://stackoverflow.com/questions/7437505/how-to-properly-use-soundpool-on-a-game

play function sometimes takes 8ms. I'm using .ogg files and the SoundPool initialization is done on the app startup mAudioManager AudioManager context.getSystemService Context.AUDIO_SERVICE mSoundPool new SoundPool size AudioManager.STREAM_MUSIC 0 mSoundPoolMap..

Android: how to play music at maximum possible volume?

http://stackoverflow.com/questions/9599259/android-how-to-play-music-at-maximum-possible-volume

using SoundManager class and this is the code which plays my ogg clip public void playSound int index int streamVolume mAudioManager.getStreamVolume AudioManager.STREAM_MUSIC mSoundPool.play mSoundPoolMap.get index streamVolume streamVolume 0 0 1.0f The.. share improve this question I'd suggest using getStreamMaxVolume and setStreamVolume to do this int origionalVolume mAudioManager.getStreamVolume AudioManager.STREAM_MUSIC mAudioManager.setStreamVolume AudioManager.STREAM_MUSIC mAudioManager.getStreamMaxVolume.. and setStreamVolume to do this int origionalVolume mAudioManager.getStreamVolume AudioManager.STREAM_MUSIC mAudioManager.setStreamVolume AudioManager.STREAM_MUSIC mAudioManager.getStreamMaxVolume AudioManager.STREAM_MUSIC 0 Then once you're..