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


Java AudioManager.STREAM_VOICE_CALL属性代码示例

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


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

示例1: getVolType

private int getVolType(String type) {
    switch (type) {
        case VOL_VOICE_CALL:
            return AudioManager.STREAM_VOICE_CALL;
        case VOL_SYSTEM:
            return AudioManager.STREAM_SYSTEM;
        case VOL_RING:
            return AudioManager.STREAM_RING;
        case VOL_ALARM:
            return AudioManager.STREAM_ALARM;
        case VOL_NOTIFICATION:
            return AudioManager.STREAM_NOTIFICATION;
        default:
            return AudioManager.STREAM_MUSIC;
    }
}
 
开发者ID:c19354837,项目名称:react-native-system-setting,代码行数:16,代码来源:SystemSetting.java

示例2: getInCallStream

/**
 * Get the stream id for in call track. Can differ on some devices. Current
 * device for which it's different :
 * 
 * @return
 */
public static int getInCallStream(boolean requestBluetooth) {
    /* Archos 5IT */
    if (Build.BRAND.equalsIgnoreCase("archos")
            && Build.DEVICE.equalsIgnoreCase("g7a")) {
        // Since archos has no voice call capabilities, voice call stream is
        // not implemented
        // So we have to choose the good stream tag, which is by default
        // falled back to music
        return AudioManager.STREAM_MUSIC;
    }
    if (requestBluetooth) {
        return 6; /* STREAM_BLUETOOTH_SCO -- Thx @Stefan for the contrib */
    }

    // return AudioManager.STREAM_MUSIC;
    return AudioManager.STREAM_VOICE_CALL;
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:23,代码来源:Compatibility.java

示例3: SignalAudioManager

public SignalAudioManager(@NonNull Context context) {
    this.context             = context.getApplicationContext();
    this.incomingRinger      = new IncomingRinger(context);
    this.outgoingRinger      = new OutgoingRinger(context);
    this.soundPool           = new SoundPool(1, AudioManager.STREAM_VOICE_CALL, 0);

    this.connectedSoundId    = this.soundPool.load(context, R.raw.webrtc_completed, 1);
    this.disconnectedSoundId = this.soundPool.load(context, R.raw.webrtc_disconnected, 1);
}
 
开发者ID:XecureIT,项目名称:PeSanKita-android,代码行数:9,代码来源:SignalAudioManager.java

示例4: DialingFeedback

public DialingFeedback(Activity context, boolean inCall) {
	
	this.context = context;
	this.inCall = inCall;
	toneStream = inCall ? AudioManager.STREAM_VOICE_CALL : AudioManager.STREAM_MUSIC;
	prefsWrapper = new PreferencesWrapper(context);
}
 
开发者ID:treasure-lau,项目名称:CSipSimple,代码行数:7,代码来源:DialingFeedback.java

示例5: onSensorChanged

@Override
public void onSensorChanged(SensorEvent event) {
  if (event.sensor.getType() != Sensor.TYPE_PROXIMITY) return;
  if (mediaPlayer == null || !mediaPlayer.isPlaying()) return;

  int streamType;

  if (event.values[0] < 5f && event.values[0] != proximitySensor.getMaximumRange()) {
    streamType = AudioManager.STREAM_VOICE_CALL;
  } else {
    streamType = AudioManager.STREAM_MUSIC;
  }

  if (streamType == AudioManager.STREAM_VOICE_CALL &&
      mediaPlayer.getAudioStreamType() != streamType &&
      !audioManager.isWiredHeadsetOn())
  {
    double position = mediaPlayer.getCurrentPosition();
    double duration = mediaPlayer.getDuration();
    double progress = position / duration;

    if (wakeLock != null) wakeLock.acquire();
    stop();
    try {
      play(progress, true);
    } catch (IOException e) {
      Log.w(TAG, e);
    }
  } else if (streamType == AudioManager.STREAM_MUSIC &&
             mediaPlayer.getAudioStreamType() != streamType &&
             System.currentTimeMillis() - startTime > 500)
  {
    if (wakeLock != null) wakeLock.release();
    stop();
    notifyOnStop();
  }
}
 
开发者ID:CableIM,项目名称:Cable-Android,代码行数:37,代码来源:AudioSlidePlayer.java

示例6: SignalAudioManager

public SignalAudioManager(@NonNull Context context) {
  this.context             = context.getApplicationContext();
  this.incomingRinger      = new IncomingRinger(context);
  this.outgoingRinger      = new OutgoingRinger(context);
  this.soundPool           = new SoundPool(1, AudioManager.STREAM_VOICE_CALL, 0);

  this.connectedSoundId    = this.soundPool.load(context, R.raw.webrtc_completed, 1);
  this.disconnectedSoundId = this.soundPool.load(context, R.raw.webrtc_disconnected, 1);
}
 
开发者ID:CableIM,项目名称:Cable-Android,代码行数:9,代码来源:SignalAudioManager.java

示例7: getUserSettingAudioStreamType

protected int getUserSettingAudioStreamType() {
	// 听筒模式/扬声器模式
	if (isEarPhoneModeEnable) {
		return AudioManager.STREAM_VOICE_CALL;
	} else {
		return AudioManager.STREAM_MUSIC;
	}
}
 
开发者ID:newDeepLearing,项目名称:decoy,代码行数:8,代码来源:BaseAudioControl.java

示例8: createAudioTrackOnLowerThanLollipop

@SuppressWarnings("deprecation") // Deprecated in API level 25.
private static AudioTrack createAudioTrackOnLowerThanLollipop(
    int sampleRateInHz, int channelConfig, int bufferSizeInBytes) {
  return new AudioTrack(AudioManager.STREAM_VOICE_CALL, sampleRateInHz, channelConfig,
      AudioFormat.ENCODING_PCM_16BIT, bufferSizeInBytes, AudioTrack.MODE_STREAM);
}
 
开发者ID:Piasy,项目名称:AppRTC-Android,代码行数:6,代码来源:WebRtcAudioTrack.java


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