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


Java C.StreamType方法代码示例

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


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

示例1: handleMessage

import com.google.android.exoplayer2.C; //导入方法依赖的package包/类
@Override
public void handleMessage(int messageType, Object message) throws ExoPlaybackException {
  switch (messageType) {
    case C.MSG_SET_VOLUME:
      audioTrack.setVolume((Float) message);
      break;
    case C.MSG_SET_STREAM_TYPE:
      @C.StreamType int streamType = (Integer) message;
      audioTrack.setStreamType(streamType);
      break;
    default:
      super.handleMessage(messageType, message);
      break;
  }
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:16,代码来源:SimpleDecoderAudioRenderer.java

示例2: setStreamType

import com.google.android.exoplayer2.C; //导入方法依赖的package包/类
/**
 * Sets the stream type for audio track. If the stream type has changed and if the audio track
 * is not configured for use with tunneling, then the audio track is reset and the audio session
 * id is cleared.
 * <p>
 * If the audio track is configured for use with tunneling then the stream type is ignored, the
 * audio track is not reset and the audio session id is not cleared. The passed stream type will
 * be used if the audio track is later re-configured into non-tunneled mode.
 *
 * @param streamType The {@link C.StreamType} to use for audio output.
 */
public void setStreamType(@C.StreamType int streamType) {
  if (this.streamType == streamType) {
    return;
  }
  this.streamType = streamType;
  if (tunneling) {
    // The stream type is ignored in tunneling mode, so no need to reset.
    return;
  }
  reset();
  audioSessionId = C.AUDIO_SESSION_ID_UNSET;
}
 
开发者ID:sanjaysingh1990,项目名称:Exoplayer2Radio,代码行数:24,代码来源:AudioTrack.java


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