本文整理汇总了Java中android.media.AudioManager.setMicrophoneMute方法的典型用法代码示例。如果您正苦于以下问题:Java AudioManager.setMicrophoneMute方法的具体用法?Java AudioManager.setMicrophoneMute怎么用?Java AudioManager.setMicrophoneMute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类android.media.AudioManager
的用法示例。
在下文中一共展示了AudioManager.setMicrophoneMute方法的8个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: startOutgoingRinger
import android.media.AudioManager; //导入方法依赖的package包/类
public void startOutgoingRinger(OutgoingRinger.Type type) {
AudioManager audioManager = ServiceUtil.getAudioManager(context);
audioManager.setMicrophoneMute(false);
if (type == OutgoingRinger.Type.SONAR) {
audioManager.setSpeakerphoneOn(false);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
} else {
audioManager.setMode(AudioManager.MODE_IN_CALL);
}
outgoingRinger.start(type);
}
示例2: stop
import android.media.AudioManager; //导入方法依赖的package包/类
public void stop(boolean playDisconnected) {
AudioManager audioManager = ServiceUtil.getAudioManager(context);
incomingRinger.stop();
outgoingRinger.stop();
if (playDisconnected) {
soundPool.play(disconnectedSoundId, 1.0f, 1.0f, 0, 0, 1.0f);
}
if (audioManager.isBluetoothScoOn()) {
audioManager.setBluetoothScoOn(false);
audioManager.stopBluetoothSco();
}
audioManager.setSpeakerphoneOn(false);
audioManager.setMicrophoneMute(false);
audioManager.setMode(AudioManager.MODE_NORMAL);
audioManager.abandonAudioFocus(null);
}
示例3: startIncomingRinger
import android.media.AudioManager; //导入方法依赖的package包/类
public void startIncomingRinger() {
AudioManager audioManager = ServiceUtil.getAudioManager(context);
boolean speaker = !audioManager.isWiredHeadsetOn() && !audioManager.isBluetoothScoOn();
audioManager.setMode(AudioManager.MODE_RINGTONE);
audioManager.setMicrophoneMute(false);
audioManager.setSpeakerphoneOn(speaker);
incomingRinger.start();
}
示例4: startOutgoingRinger
import android.media.AudioManager; //导入方法依赖的package包/类
public void startOutgoingRinger(OutgoingRinger.Type type) {
AudioManager audioManager = ServiceUtil.getAudioManager(context);
audioManager.setMicrophoneMute(false);
if (type == OutgoingRinger.Type.SONAR) {
audioManager.setSpeakerphoneOn(false);
}
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
} else {
audioManager.setMode(AudioManager.MODE_IN_CALL);
}
outgoingRinger.start(type);
}
示例5: stop
import android.media.AudioManager; //导入方法依赖的package包/类
public void stop(boolean playDisconnected) {
AudioManager audioManager = ServiceUtil.getAudioManager(context);
incomingRinger.stop();
outgoingRinger.stop();
if (playDisconnected) {
soundPool.play(disconnectedSoundId, 1.0f, 1.0f, 0, 0, 1.0f);
}
if (audioManager.isBluetoothScoOn()) {
audioManager.setBluetoothScoOn(false);
audioManager.stopBluetoothSco();
}
audioManager.setSpeakerphoneOn(false);
audioManager.setMicrophoneMute(false);
audioManager.setMode(AudioManager.MODE_NORMAL);
audioManager.abandonAudioFocus(null);
}
示例6: onUnMuteMicrophone
import android.media.AudioManager; //导入方法依赖的package包/类
private boolean onUnMuteMicrophone()
{
try
{
AudioManager audioManager = (AudioManager) getApplicationContext().getSystemService(Context.AUDIO_SERVICE);
isMicrophoneMute = audioManager.isMicrophoneMute();
if(isMicrophoneMute == true)
{
audioManager.setMicrophoneMute(false);
}
return true;
}
catch (Exception e)
{
Log.e("RecordService", "onUnMuteMicrophone : " + getApplicationContext().getString(R.string.log_record_service_error_unmute_microphone) + " : " + e);
databaseManager.insertLog(getApplicationContext(), "" + getApplicationContext().getString(R.string.log_record_service_error_unmute_microphone), new Date().getTime(), 1, false);
return false;
}
}
示例7: onResetMicrophoneMute
import android.media.AudioManager; //导入方法依赖的package包/类
private void onResetMicrophoneMute()
{
try
{
if(isMicrophoneMute == true)
{
AudioManager audioManager = (AudioManager) getApplicationContext().getSystemService(Context.AUDIO_SERVICE);
audioManager.setMicrophoneMute(true);
}
}
catch (Exception e)
{
Log.e("RecordService", "onResetMicrophoneMute : " + getApplicationContext().getString(R.string.log_record_service_reset_mute_microphone) + " : " + e);
databaseManager.insertLog(getApplicationContext(), "" + getApplicationContext().getString(R.string.log_record_service_reset_mute_microphone), new Date().getTime(), 1, false);
}
}
示例8: startIncomingRinger
import android.media.AudioManager; //导入方法依赖的package包/类
public void startIncomingRinger() {
AudioManager audioManager = ServiceUtil.getAudioManager(context);
boolean speaker = !audioManager.isWiredHeadsetOn() && !audioManager.isBluetoothScoOn();
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.HONEYCOMB) {
audioManager.setMode(AudioManager.MODE_IN_COMMUNICATION);
} else {
audioManager.setMode(AudioManager.MODE_IN_CALL);
}
audioManager.setMicrophoneMute(false);
audioManager.setSpeakerphoneOn(speaker);
incomingRinger.start(speaker);
}