Package ai.nexconn.call.api
Class NCCallAudioFrame
java.lang.Object
ai.nexconn.call.api.NCCallAudioFrame
Audio frame data.
-
Constructor Summary
ConstructorsConstructorDescriptionNCCallAudioFrame(byte[] bytes, int channels, int sampleRate, int bytesPerSample) -
Method Summary
Modifier and TypeMethodDescriptionbyte[]getBytes()Audio data buffer.intReturns the number of bytes per sample.intReturns the number of channels.intReturns the audio sample rate.intReturns the number of samples per channel.longReturns the relative timestamp of the current audio frame.voidsetBytes(byte[] bytes) voidsetBytesPerSample(int bytesPerSample) voidsetChannels(int channels) voidsetSampleRate(int sampleRate) voidsetTimestamp(long timestamp)
-
Constructor Details
-
NCCallAudioFrame
public NCCallAudioFrame() -
NCCallAudioFrame
public NCCallAudioFrame(byte[] bytes, int channels, int sampleRate, int bytesPerSample)
-
-
Method Details
-
getBytes
public byte[] getBytes()Audio data buffer. For stereo audio, the data is interleaved. Buffer size in bytes = samples x channels x bytesPerSample. -
getChannels
public int getChannels()Returns the number of channels. Mono: 1. Stereo: 2. -
getSampleRate
public int getSampleRate()Returns the audio sample rate. Common values are 16000, 32000, 44100, and 48000 Hz. -
getBytesPerSample
public int getBytesPerSample()Returns the number of bytes per sample. PCM usually uses 16 bits, which is 2 bytes. -
setBytesPerSample
public void setBytesPerSample(int bytesPerSample) -
getSamples
public int getSamples()Returns the number of samples per channel. -
setBytes
public void setBytes(byte[] bytes) -
setChannels
public void setChannels(int channels) -
setSampleRate
public void setSampleRate(int sampleRate) -
getTimestamp
public long getTimestamp()Returns the relative timestamp of the current audio frame. -
setTimestamp
public void setTimestamp(long timestamp)
-