Java Code Examples for com.google.android.exoplayer2.C#AudioContentType

The following examples show how to use com.google.android.exoplayer2.C#AudioContentType . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: Util.java    From MediaSDK with Apache License 2.0 6 votes vote down vote up
/**
 * Returns the {@link C.AudioContentType} corresponding to the specified {@link C.StreamType}.
 */
@C.AudioContentType
public static int getAudioContentTypeForStreamType(@C.StreamType int streamType) {
  switch (streamType) {
    case C.STREAM_TYPE_ALARM:
    case C.STREAM_TYPE_DTMF:
    case C.STREAM_TYPE_NOTIFICATION:
    case C.STREAM_TYPE_RING:
    case C.STREAM_TYPE_SYSTEM:
      return C.CONTENT_TYPE_SONIFICATION;
    case C.STREAM_TYPE_VOICE_CALL:
      return C.CONTENT_TYPE_SPEECH;
    case C.STREAM_TYPE_USE_DEFAULT:
    case C.STREAM_TYPE_MUSIC:
    default:
      return C.CONTENT_TYPE_MUSIC;
  }
}
 
Example 2
Source File: Util.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the {@link C.AudioContentType} corresponding to the specified {@link C.StreamType}.
 */
@C.AudioContentType
public static int getAudioContentTypeForStreamType(@C.StreamType int streamType) {
  switch (streamType) {
    case C.STREAM_TYPE_ALARM:
    case C.STREAM_TYPE_DTMF:
    case C.STREAM_TYPE_NOTIFICATION:
    case C.STREAM_TYPE_RING:
    case C.STREAM_TYPE_SYSTEM:
      return C.CONTENT_TYPE_SONIFICATION;
    case C.STREAM_TYPE_VOICE_CALL:
      return C.CONTENT_TYPE_SPEECH;
    case C.STREAM_TYPE_USE_DEFAULT:
    case C.STREAM_TYPE_MUSIC:
    default:
      return C.CONTENT_TYPE_MUSIC;
  }
}
 
Example 3
Source File: Util.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the {@link C.AudioContentType} corresponding to the specified {@link C.StreamType}.
 */
@C.AudioContentType
public static int getAudioContentTypeForStreamType(@C.StreamType int streamType) {
  switch (streamType) {
    case C.STREAM_TYPE_ALARM:
    case C.STREAM_TYPE_DTMF:
    case C.STREAM_TYPE_NOTIFICATION:
    case C.STREAM_TYPE_RING:
    case C.STREAM_TYPE_SYSTEM:
      return C.CONTENT_TYPE_SONIFICATION;
    case C.STREAM_TYPE_VOICE_CALL:
      return C.CONTENT_TYPE_SPEECH;
    case C.STREAM_TYPE_USE_DEFAULT:
    case C.STREAM_TYPE_MUSIC:
    default:
      return C.CONTENT_TYPE_MUSIC;
  }
}
 
Example 4
Source File: Util.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the {@link C.AudioContentType} corresponding to the specified {@link C.StreamType}.
 */
@C.AudioContentType
public static int getAudioContentTypeForStreamType(@C.StreamType int streamType) {
  switch (streamType) {
    case C.STREAM_TYPE_ALARM:
    case C.STREAM_TYPE_DTMF:
    case C.STREAM_TYPE_NOTIFICATION:
    case C.STREAM_TYPE_RING:
    case C.STREAM_TYPE_SYSTEM:
      return C.CONTENT_TYPE_SONIFICATION;
    case C.STREAM_TYPE_VOICE_CALL:
      return C.CONTENT_TYPE_SPEECH;
    case C.STREAM_TYPE_USE_DEFAULT:
    case C.STREAM_TYPE_MUSIC:
    default:
      return C.CONTENT_TYPE_MUSIC;
  }
}
 
Example 5
Source File: Util.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the {@link C.AudioContentType} corresponding to the specified {@link C.StreamType}.
 */
@C.AudioContentType
public static int getAudioContentTypeForStreamType(@C.StreamType int streamType) {
  switch (streamType) {
    case C.STREAM_TYPE_ALARM:
    case C.STREAM_TYPE_DTMF:
    case C.STREAM_TYPE_NOTIFICATION:
    case C.STREAM_TYPE_RING:
    case C.STREAM_TYPE_SYSTEM:
      return C.CONTENT_TYPE_SONIFICATION;
    case C.STREAM_TYPE_VOICE_CALL:
      return C.CONTENT_TYPE_SPEECH;
    case C.STREAM_TYPE_USE_DEFAULT:
    case C.STREAM_TYPE_MUSIC:
    default:
      return C.CONTENT_TYPE_MUSIC;
  }
}
 
Example 6
Source File: AudioAttributes.java    From MediaSDK with Apache License 2.0 5 votes vote down vote up
private AudioAttributes(
    @C.AudioContentType int contentType,
    @C.AudioFlags int flags,
    @C.AudioUsage int usage,
    @C.AudioAllowedCapturePolicy int allowedCapturePolicy) {
  this.contentType = contentType;
  this.flags = flags;
  this.usage = usage;
  this.allowedCapturePolicy = allowedCapturePolicy;
}
 
Example 7
Source File: ExoMediaPlayer.java    From ExoMedia with Apache License 2.0 5 votes vote down vote up
public void setAudioStreamType(int streamType) {
    @C.AudioUsage
    int usage = Util.getAudioUsageForStreamType(streamType);
    @C.AudioContentType
    int contentType = Util.getAudioContentTypeForStreamType(streamType);

    AudioAttributes audioAttributes = new AudioAttributes.Builder()
            .setUsage(usage)
            .setContentType(contentType)
            .build();

    sendMessage(C.TRACK_TYPE_AUDIO, C.MSG_SET_AUDIO_ATTRIBUTES, audioAttributes);
}
 
Example 8
Source File: AudioAttributes.java    From MediaSDK with Apache License 2.0 4 votes vote down vote up
/**
 * @see android.media.AudioAttributes.Builder#setContentType(int)
 */
public Builder setContentType(@C.AudioContentType int contentType) {
  this.contentType = contentType;
  return this;
}
 
Example 9
Source File: AudioAttributes.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @see android.media.AudioAttributes.Builder#setContentType(int)
 */
public Builder setContentType(@C.AudioContentType int contentType) {
  this.contentType = contentType;
  return this;
}
 
Example 10
Source File: AudioAttributes.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
private AudioAttributes(@C.AudioContentType int contentType, @C.AudioFlags int flags,
    @C.AudioUsage int usage) {
  this.contentType = contentType;
  this.flags = flags;
  this.usage = usage;
}
 
Example 11
Source File: AudioAttributes.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @see android.media.AudioAttributes.Builder#setContentType(int)
 */
public Builder setContentType(@C.AudioContentType int contentType) {
  this.contentType = contentType;
  return this;
}
 
Example 12
Source File: AudioAttributes.java    From TelePlus-Android with GNU General Public License v2.0 4 votes vote down vote up
private AudioAttributes(@C.AudioContentType int contentType, @C.AudioFlags int flags,
    @C.AudioUsage int usage) {
  this.contentType = contentType;
  this.flags = flags;
  this.usage = usage;
}
 
Example 13
Source File: AudioAttributes.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @see android.media.AudioAttributes.Builder#setContentType(int)
 */
public Builder setContentType(@C.AudioContentType int contentType) {
  this.contentType = contentType;
  return this;
}
 
Example 14
Source File: AudioAttributes.java    From Telegram-FOSS with GNU General Public License v2.0 4 votes vote down vote up
private AudioAttributes(@C.AudioContentType int contentType, @C.AudioFlags int flags,
    @C.AudioUsage int usage) {
  this.contentType = contentType;
  this.flags = flags;
  this.usage = usage;
}
 
Example 15
Source File: AudioAttributes.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
/**
 * @see android.media.AudioAttributes.Builder#setContentType(int)
 */
public Builder setContentType(@C.AudioContentType int contentType) {
  this.contentType = contentType;
  return this;
}
 
Example 16
Source File: AudioAttributes.java    From Telegram with GNU General Public License v2.0 4 votes vote down vote up
private AudioAttributes(@C.AudioContentType int contentType, @C.AudioFlags int flags,
    @C.AudioUsage int usage) {
  this.contentType = contentType;
  this.flags = flags;
  this.usage = usage;
}