class AgoraAudioVadManager
extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
private java.lang.String |
apmDumpPath
Base path for VAD dump files.
|
private boolean |
enableApmDump
Indicates whether APM dump output is enabled.
|
private boolean |
isInitialized
Flag indicating whether the manager has been initialized
|
private AgoraAudioVadConfigV2 |
vadConfig
VAD configuration
|
private java.util.Map<java.lang.String,VadDumpUtils> |
vadDumpUtilsMap
Map storing dump utilities for each VAD instance when dumping is enabled.
|
private java.util.Map<java.lang.String,AgoraAudioVadV2> |
vadInstanceMap
Map to store VAD instances for different channels and users
|
| Constructor and Description |
|---|
AgoraAudioVadManager(AgoraAudioVadConfigV2 configure,
boolean enableApmDump,
java.lang.String apmDumpPath)
Constructor for AudioVadManager
|
| Modifier and Type | Method and Description |
|---|---|
private AgoraAudioVadV2 |
addVadInstance(java.lang.String channelId,
java.lang.String userId)
Adds (or retrieves) a VAD instance for the specified channel and user.
|
void |
delVadInstance(java.lang.String channelId,
java.lang.String userId)
Removes and destroys the specified VAD instance
|
void |
destroy()
Destroys the manager
Cleans up all VAD instances and releases resources
Thread-safe method
|
private VadDumpUtils |
getVadDumpUtils(java.lang.String channelId,
java.lang.String userId)
Retrieves the dump utility associated with a VAD instance.
|
AgoraAudioVadV2 |
getVadInstance(java.lang.String channelId,
java.lang.String userId)
Retrieves the VAD instance for specified channel and user
|
private java.lang.String |
makeKey(java.lang.String channelId,
java.lang.String userId)
Generates a unique key for VAD instance identification
|
VadProcessResult |
process(java.lang.String channelId,
java.lang.String userId,
AudioFrame frame)
Processes an audio frame through VAD
|
private volatile java.util.Map<java.lang.String,AgoraAudioVadV2> vadInstanceMap
private volatile java.util.Map<java.lang.String,VadDumpUtils> vadDumpUtilsMap
private volatile AgoraAudioVadConfigV2 vadConfig
private volatile boolean isInitialized
private volatile boolean enableApmDump
private volatile java.lang.String apmDumpPath
public AgoraAudioVadManager(AgoraAudioVadConfigV2 configure, boolean enableApmDump, java.lang.String apmDumpPath)
configure - VAD configuration parameters, must not be nullenableApmDump - whether to enable APM dump for debuggingapmDumpPath - the path to save APM dump filesjava.lang.IllegalArgumentException - when configure is nullprivate java.lang.String makeKey(java.lang.String channelId,
java.lang.String userId)
channelId - Channel IDuserId - User IDpublic AgoraAudioVadV2 getVadInstance(java.lang.String channelId, java.lang.String userId)
channelId - Channel IDuserId - User IDprivate VadDumpUtils getVadDumpUtils(java.lang.String channelId, java.lang.String userId)
channelId - Channel identifieruserId - User identifiernull if dumping is disabled or parameters are invalidprivate AgoraAudioVadV2 addVadInstance(java.lang.String channelId, java.lang.String userId)
channelId - Channel identifieruserId - User identifiernull if initialization failedpublic void delVadInstance(java.lang.String channelId,
java.lang.String userId)
channelId - Channel IDuserId - User IDpublic VadProcessResult process(java.lang.String channelId, java.lang.String userId, AudioFrame frame)
channelId - Channel IDuserId - User IDframe - Audio frame to be processedpublic void destroy()