Package com.twilio.voice
Class AudioFormat
- java.lang.Object
-
- com.twilio.voice.AudioFormat
-
public class AudioFormat extends java.lang.Object
AudioFormat describes 16-bit signed Linear Pulse Code Modulation (LPCM) audio. This class allows developers to customize the audio format used for audio capturing or rendering. Supported sample rate values are 8000, 16000, 24000, 32000, 44100 and 48000 Hz. Only mono(number of channels 1) and stereo(number of channels 2) are supported by the SDK
-
-
Field Summary
Fields Modifier and Type Field Description static int
AUDIO_SAMPLE_MONO
static int
AUDIO_SAMPLE_RATE_16000
static int
AUDIO_SAMPLE_RATE_24000
static int
AUDIO_SAMPLE_RATE_32000
static int
AUDIO_SAMPLE_RATE_44100
static int
AUDIO_SAMPLE_RATE_48000
static int
AUDIO_SAMPLE_RATE_8000
static int
AUDIO_SAMPLE_STEREO
-
Constructor Summary
Constructors Constructor Description AudioFormat(int sampleRate, int channelCount)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getChannelCount()
Returns the number of channels in the audio stream.int
getSampleRate()
Returns the sample rate of the audio stream.
-
-
-
Field Detail
-
AUDIO_SAMPLE_RATE_8000
public static final int AUDIO_SAMPLE_RATE_8000
- See Also:
- Constant Field Values
-
AUDIO_SAMPLE_RATE_16000
public static final int AUDIO_SAMPLE_RATE_16000
- See Also:
- Constant Field Values
-
AUDIO_SAMPLE_RATE_24000
public static final int AUDIO_SAMPLE_RATE_24000
- See Also:
- Constant Field Values
-
AUDIO_SAMPLE_RATE_32000
public static final int AUDIO_SAMPLE_RATE_32000
- See Also:
- Constant Field Values
-
AUDIO_SAMPLE_RATE_44100
public static final int AUDIO_SAMPLE_RATE_44100
- See Also:
- Constant Field Values
-
AUDIO_SAMPLE_RATE_48000
public static final int AUDIO_SAMPLE_RATE_48000
- See Also:
- Constant Field Values
-
AUDIO_SAMPLE_MONO
public static int AUDIO_SAMPLE_MONO
-
AUDIO_SAMPLE_STEREO
public static final int AUDIO_SAMPLE_STEREO
- See Also:
- Constant Field Values
-
-
Method Detail
-
getSampleRate
public int getSampleRate()
Returns the sample rate of the audio stream. Valid values for this property are 8000, 16000, 24000, 32000, 44100 and 48000 Hz.- Returns:
- sampleRate
-
getChannelCount
public int getChannelCount()
Returns the number of channels in the audio stream.- Returns:
- channelCount
-
-