当前位置: 首页>>代码示例>>Java>>正文


Java AudioManager.setMicrophoneMute方法代码示例

本文整理汇总了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);
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:17,代码来源:SignalAudioManager.java

示例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);
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:21,代码来源:SignalAudioManager.java

示例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();
}
 
开发者ID:CableIM,项目名称:Cable-Android,代码行数:11,代码来源:SignalAudioManager.java

示例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);
}
 
开发者ID:CableIM,项目名称:Cable-Android,代码行数:17,代码来源:SignalAudioManager.java

示例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);
}
 
开发者ID:CableIM,项目名称:Cable-Android,代码行数:21,代码来源:SignalAudioManager.java

示例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;
}
  }
 
开发者ID:vassela,项目名称:AC2RD,代码行数:23,代码来源:RecordService.java

示例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);
}
  }
 
开发者ID:vassela,项目名称:AC2RD,代码行数:18,代码来源:RecordService.java

示例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);
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:16,代码来源:SignalAudioManager.java


注:本文中的android.media.AudioManager.setMicrophoneMute方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。