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

The following examples show how to use com.google.android.exoplayer2.C#STREAM_TYPE_USE_DEFAULT . 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.AudioUsage} corresponding to the specified {@link C.StreamType}.
 */
@C.AudioUsage
public static int getAudioUsageForStreamType(@C.StreamType int streamType) {
  switch (streamType) {
    case C.STREAM_TYPE_ALARM:
      return C.USAGE_ALARM;
    case C.STREAM_TYPE_DTMF:
      return C.USAGE_VOICE_COMMUNICATION_SIGNALLING;
    case C.STREAM_TYPE_NOTIFICATION:
      return C.USAGE_NOTIFICATION;
    case C.STREAM_TYPE_RING:
      return C.USAGE_NOTIFICATION_RINGTONE;
    case C.STREAM_TYPE_SYSTEM:
      return C.USAGE_ASSISTANCE_SONIFICATION;
    case C.STREAM_TYPE_VOICE_CALL:
      return C.USAGE_VOICE_COMMUNICATION;
    case C.STREAM_TYPE_USE_DEFAULT:
    case C.STREAM_TYPE_MUSIC:
    default:
      return C.USAGE_MEDIA;
  }
}
 
Example 2
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 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.AudioUsage} corresponding to the specified {@link C.StreamType}.
 */
@C.AudioUsage
public static int getAudioUsageForStreamType(@C.StreamType int streamType) {
  switch (streamType) {
    case C.STREAM_TYPE_ALARM:
      return C.USAGE_ALARM;
    case C.STREAM_TYPE_DTMF:
      return C.USAGE_VOICE_COMMUNICATION_SIGNALLING;
    case C.STREAM_TYPE_NOTIFICATION:
      return C.USAGE_NOTIFICATION;
    case C.STREAM_TYPE_RING:
      return C.USAGE_NOTIFICATION_RINGTONE;
    case C.STREAM_TYPE_SYSTEM:
      return C.USAGE_ASSISTANCE_SONIFICATION;
    case C.STREAM_TYPE_VOICE_CALL:
      return C.USAGE_VOICE_COMMUNICATION;
    case C.STREAM_TYPE_USE_DEFAULT:
    case C.STREAM_TYPE_MUSIC:
    default:
      return C.USAGE_MEDIA;
  }
}
 
Example 4
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 5
Source File: Util.java    From TelePlus-Android with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the {@link C.AudioUsage} corresponding to the specified {@link C.StreamType}.
 */
@C.AudioUsage
public static int getAudioUsageForStreamType(@C.StreamType int streamType) {
  switch (streamType) {
    case C.STREAM_TYPE_ALARM:
      return C.USAGE_ALARM;
    case C.STREAM_TYPE_DTMF:
      return C.USAGE_VOICE_COMMUNICATION_SIGNALLING;
    case C.STREAM_TYPE_NOTIFICATION:
      return C.USAGE_NOTIFICATION;
    case C.STREAM_TYPE_RING:
      return C.USAGE_NOTIFICATION_RINGTONE;
    case C.STREAM_TYPE_SYSTEM:
      return C.USAGE_ASSISTANCE_SONIFICATION;
    case C.STREAM_TYPE_VOICE_CALL:
      return C.USAGE_VOICE_COMMUNICATION;
    case C.STREAM_TYPE_USE_DEFAULT:
    case C.STREAM_TYPE_MUSIC:
    default:
      return C.USAGE_MEDIA;
  }
}
 
Example 6
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 7
Source File: Util.java    From Telegram-FOSS with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the {@link C.AudioUsage} corresponding to the specified {@link C.StreamType}.
 */
@C.AudioUsage
public static int getAudioUsageForStreamType(@C.StreamType int streamType) {
  switch (streamType) {
    case C.STREAM_TYPE_ALARM:
      return C.USAGE_ALARM;
    case C.STREAM_TYPE_DTMF:
      return C.USAGE_VOICE_COMMUNICATION_SIGNALLING;
    case C.STREAM_TYPE_NOTIFICATION:
      return C.USAGE_NOTIFICATION;
    case C.STREAM_TYPE_RING:
      return C.USAGE_NOTIFICATION_RINGTONE;
    case C.STREAM_TYPE_SYSTEM:
      return C.USAGE_ASSISTANCE_SONIFICATION;
    case C.STREAM_TYPE_VOICE_CALL:
      return C.USAGE_VOICE_COMMUNICATION;
    case C.STREAM_TYPE_USE_DEFAULT:
    case C.STREAM_TYPE_MUSIC:
    default:
      return C.USAGE_MEDIA;
  }
}
 
Example 8
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 9
Source File: Util.java    From Telegram with GNU General Public License v2.0 6 votes vote down vote up
/**
 * Returns the {@link C.AudioUsage} corresponding to the specified {@link C.StreamType}.
 */
@C.AudioUsage
public static int getAudioUsageForStreamType(@C.StreamType int streamType) {
  switch (streamType) {
    case C.STREAM_TYPE_ALARM:
      return C.USAGE_ALARM;
    case C.STREAM_TYPE_DTMF:
      return C.USAGE_VOICE_COMMUNICATION_SIGNALLING;
    case C.STREAM_TYPE_NOTIFICATION:
      return C.USAGE_NOTIFICATION;
    case C.STREAM_TYPE_RING:
      return C.USAGE_NOTIFICATION_RINGTONE;
    case C.STREAM_TYPE_SYSTEM:
      return C.USAGE_ASSISTANCE_SONIFICATION;
    case C.STREAM_TYPE_VOICE_CALL:
      return C.USAGE_VOICE_COMMUNICATION;
    case C.STREAM_TYPE_USE_DEFAULT:
    case C.STREAM_TYPE_MUSIC:
    default:
      return C.USAGE_MEDIA;
  }
}
 
Example 10
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;
  }
}