class PcmConsumeStateUtils
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private int |
audioScenario
Audio scenario
|
private int |
duration
Duration in milliseconds
|
private static int |
E2E_DELAY_MS
End-to-end delay in milliseconds
|
private long |
startTime
Start time in milliseconds
|
private long |
totalLength
Total length of PCM data
|
| Constructor and Description |
|---|
PcmConsumeStateUtils()
Default constructor for PcmConsumeStateUtils.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPcmData(int dataLen,
int samplerate,
int channels)
Adds PCM data and updates duration.
|
int |
getAudioScenario()
Gets the audio scenario.
|
int |
getDuration()
Gets the duration in milliseconds.
|
long |
getStartTime()
Gets the start time in milliseconds.
|
long |
getTotalLength()
Gets the total length of PCM data.
|
boolean |
isNewRound()
Checks if it's a new round.
|
boolean |
isPushCompleted()
Checks if push is completed.
|
void |
reset()
Resets the state.
|
void |
setAudioScenario(int audioScenario)
Sets the audio scenario.
|
void |
setDuration(int duration)
Sets the duration in milliseconds.
|
void |
setStartTime(long startTime)
Sets the start time in milliseconds.
|
void |
setTotalLength(long totalLength)
Sets the total length of PCM data.
|
private static final int E2E_DELAY_MS
private long startTime
private long totalLength
private int duration
private int audioScenario
public PcmConsumeStateUtils()
public long getStartTime()
public void setStartTime(long startTime)
startTime - Start time in millisecondspublic long getTotalLength()
public void setTotalLength(long totalLength)
totalLength - Total length of PCM datapublic int getDuration()
public void setDuration(int duration)
duration - Duration in millisecondspublic int getAudioScenario()
public void setAudioScenario(int audioScenario)
audioScenario - Audio scenariopublic void reset()
public void addPcmData(int dataLen,
int samplerate,
int channels)
dataLen - Data lengthsamplerate - Sample rate (Hz)channels - Number of channelspublic boolean isNewRound()
public boolean isPushCompleted()