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


Java AudioManager.MODE_NORMAL属性代码示例

本文整理汇总了Java中android.media.AudioManager.MODE_NORMAL属性的典型用法代码示例。如果您正苦于以下问题:Java AudioManager.MODE_NORMAL属性的具体用法?Java AudioManager.MODE_NORMAL怎么用?Java AudioManager.MODE_NORMAL使用的例子?那么恭喜您, 这里精选的属性代码示例或许可以为您提供帮助。您也可以进一步了解该属性所在android.media.AudioManager的用法示例。


在下文中一共展示了AudioManager.MODE_NORMAL属性的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。

示例1: execute

@Override
public void execute(AudioManager audioManager) {
    if (voiceMediator.isBlueToothHeadSet()) {
        if (!voiceMediator.isSuportA2DP()) {
            if (audioManager.getMode() != AudioManager.MODE_NORMAL) {
                Log.e(TAG, "playInChannel>>setMode(AudioManager.MODE_NORMAL)");
                audioManager.setMode(AudioManager.MODE_NORMAL);
            }
            if (audioManager.isBluetoothScoOn()) {
                audioManager.setBluetoothScoOn(false);
                audioManager.stopBluetoothSco();
            }
        } else {
            if (!audioManager.isBluetoothA2dpOn()) {
                Log.e(TAG, "playInChannel>>setBluetoothA2dpOn(true)");
                audioManager.setBluetoothA2dpOn(true);
            }
        }
    }
}
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:20,代码来源:AssistantService.java

示例2: getAudioTargetMode

private int getAudioTargetMode() {
	int targetMode = modeSipInCall;
	
	if(service.getPrefs().useModeApi()) {
           Log.d(THIS_FILE, "User want speaker now..." + userWantSpeaker);
		if(!service.getPrefs().generateForSetCall()) {
			return userWantSpeaker ? AudioManager.MODE_NORMAL : AudioManager.MODE_IN_CALL;
		}else {
			return userWantSpeaker ? AudioManager.MODE_IN_CALL: AudioManager.MODE_NORMAL ;
		}
	}
	if(userWantBluetooth) {
	    targetMode = AudioManager.MODE_NORMAL;
	}

	Log.d(THIS_FILE, "Target mode... : " + targetMode);
	return targetMode;
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:18,代码来源:MediaManager.java

示例3: setDefaultSynthesizerParam

/**
   * 设置默认的合成引擎
   *
   * @param type
   */
  private void setDefaultSynthesizerParam(NetType type) {
      if (isSpeaking()) {
          Log.e(TAG, "播放当中切换播放引擎失败");
          return;
      }
      synthesizer.setParameter(SpeechConstant.SPEED, Integer.toString(mVoiceConfig.getVolSpeed()));
      synthesizer.setParameter(SpeechConstant.VOLUME, Integer.toString(mVoiceConfig.getVolume()));
      synthesizer.setParameter(SpeechConstant.VOICE_NAME, mVoiceConfig.getVolName());
      synthesizer.setParameter("rdn", "0");
      synthesizer.setParameter(SpeechConstant.KEY_REQUEST_FOCUS, "0");
      if (mediator.isBlueToothHeadSet()) {
          synthesizer.setParameter(SpeechConstant.STREAM_TYPE, Integer.toString(AudioManager.STREAM_VOICE_CALL));
      } else {
          synthesizer.setParameter(SpeechConstant.STREAM_TYPE, Integer.toString(AudioManager.STREAM_MUSIC));
          AudioManager am = (AudioManager) mContext.getSystemService(Context.AUDIO_SERVICE);
          if (am.getMode() != AudioManager.MODE_NORMAL) {
              am.setMode(AudioManager.MODE_NORMAL);
          }
      }
      //synthesizer.setParameter(SpeechConstant.ENGINE_TYPE, VoiceConfig.getSynEngineType());
      /*if(type==NetType.NETWORK_TYPE_NONE||type==NetType.NETWORK_TYPE_2G){//网络关闭的状态下启动离线识别
          Log.e(TAG, "离线。。。。。。。。。。。。。。。。。。。");
	synthesizer.setParameter(SpeechConstant.SPEED, OFFLINE_ENGINE_SPPED);
	synthesizer.setParameter(SpeechConstant.ENGINE_TYPE, SpeechConstant.TYPE_LOCAL);
	synthesizer.setParameter(SpeechConstant.VOICE_NAME, "xiaoyan");
	isLocalEngine=true;
}
else{*/
      Log.e(TAG, "在线。。。。。。。。。。。。。。。。。。。");
      //synthesizer.setParameter(SpeechConstant.SPEED,"70");
      synthesizer.setParameter(SpeechConstant.VOICE_NAME, mVoiceConfig.getVolName());
      //synthesizer.setParameter(SpeechConstant.VOICE_NAME, ChatRobot.isInit()&&ChatRobot.getInstance().getMode()==ChatConstant.CHILDREN_MODE?"vinn":"vixq");
      synthesizer.setParameter(SpeechConstant.ENGINE_TYPE, SpeechConstant.TYPE_CLOUD);
      //}
  }
 
开发者ID:LingjuAI,项目名称:AssistantBySDK,代码行数:40,代码来源:IflySynthesizer.java

示例4: getInCallMode

/**
 * Get the audio codec quality setting
 * 
 * @return the audio quality
 */
public int getInCallMode() {
    String mode = getPreferenceStringValue(SipConfigManager.SIP_AUDIO_MODE);
    try {
        return Integer.parseInt(mode);
    } catch (NumberFormatException e) {
        Log.e(THIS_FILE, "In call mode " + mode + " not well formated");
    }

    return AudioManager.MODE_NORMAL;
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:15,代码来源:PreferencesProviderWrapper.java

示例5: setAudioMode

public  void setAudioMode(int mode,Context ctx) {
    if (mode != AudioManager.MODE_NORMAL && mode != AudioManager.MODE_IN_CALL) {
        return;
    }
    AudioManager audioManager = (AudioManager) ctx.getSystemService(Context.AUDIO_SERVICE);
    audioManager.setMode(mode);
}
 
开发者ID:ccfish86,项目名称:sctalk,代码行数:7,代码来源:AudioPlayerHandler.java

示例6: onSpeakerClick

@Override
public void onSpeakerClick() {
    AudioPlayerHandler audioPlayerHandler = AudioPlayerHandler.getInstance();
    if (audioPlayerHandler.getAudioMode(ctx) == AudioManager.MODE_NORMAL) {
        audioPlayerHandler.setAudioMode(AudioManager.MODE_IN_CALL, ctx);
        SpeekerToast.show(ctx, ctx.getText(R.string.audio_in_call), Toast.LENGTH_SHORT);
    } else {
        audioPlayerHandler.setAudioMode(AudioManager.MODE_NORMAL, ctx);
        SpeekerToast.show(ctx, ctx.getText(R.string.audio_in_speeker), Toast.LENGTH_SHORT);
    }
}
 
开发者ID:ccfish86,项目名称:sctalk,代码行数:11,代码来源:MessageAdapter.java


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