Audio
Enable Audio
The enableAudio method enables the local microphone and starts producing the audio stream with the label audio.
Example
// Enable audio stream
await huddleClient.localPeer.enableAudio();Disable Audio
The disableAudio method stops the local audio stream and also stops producing the audio stream with remote peers.
Example
// Disable audio stream
await huddleClient.localPeer.disableAudio();replaceAudioStream
The replaceAudioStream method replaces the current audio stream with the new stream.
Parameters
| Params | Type | Description | Return Type |
|---|---|---|---|
| mediastream | MediaStream | This function replaces the audio stream | Promise<void> |
Example
// Usage
await huddleClient.localPeer.replaceAudioStream({MediaStream});changeAudioSource
The changeAudioSource changes the Audio source to the given deviceId, sets the preferred mic device as the given deviceId
Parameters
| Params | Type | Description | Return Type |
|---|---|---|---|
| deviceId | string | changes the audio source to the given deviceId | Promise<void> |
Example
// Usage
await huddleClient.localPeer.changeAudioSource({deviceId});