Note
Access to this page requires authorization. You can try signing in or changing directories.
Access to this page requires authorization. You can try changing directories.
Dragon Copilot SDK for JavaScript starts and stops recording in the following ways:
Programmatically: Your integration calls
startRecording,stopRecordingortoggleRecording.Microphone button: The user presses the record button on a Nuance PowerMic or Philips SpeechMike.
Control recording programmatically
Use the recording APIs to build your custom recording UI. For example:
A record button can use
DragonCopilotSDK.dragon.recording.toggleRecordingto start and stop ambient recording or dictation.Use the
recordingStartedandrecordingStoppedevents to update the recording state shown to the user.Use the
recordingVolumeChangedevent to represent the volume of speech on a volume meter.
Prerequisites
You've added the Dragon Copilot SDK to your page.
You've initialized the SDK.
For ambient recording, you've set up note and transcript delivery using Dragon data exchange. For more information, see: Provision a webhook and Webhooks.
For ambient recording, you've provided the ambient session data.
Start and stop recording
The following APIs are asynchronous and accept a recordingMode property, which you can set to "dictation" or "ambient":
To start recording, call
DragonCopilotSDK.dragon.recording.startRecording.To stop recording, call
DragonCopilotSDK.dragon.recording.stopRecording.To toggle recording, call
DragonCopilotSDK.dragon.recording.toggleRecording.
For more information on ambient recording, see: Start ambient recording.
Important
Don't assume that calling DragonCopilotSDK.dragon.recording.toggleRecording/startRecording/stopRecording immediately starts and stops recording. Use the recordingStarted and recordingStopped events to update the recording state shown to the user and keep the UI state aligned with the SDK's recording state. Allowing the UI state to become misaligned with the recording state can make users think that recording has stopped when it's still on, and vice versa.
Enable and disable ambient recording
The following APIs are synchronous and only affect ambient recording:
To disable ambient recording, call
DragonCopilotSDK.dragon.recording.disableRecordingwithrecordingMode: "ambient".To enable ambient recording, call
DragonCopilotSDK.dragon.recording.enableRecordingwithrecordingMode: "ambient".
Events
Use DragonCopilotSDK.dragon.recording.events.addEventListener to add event listeners for recording events.
| Event | Description |
|---|---|
recordingStarted |
Recording has started. |
recordingStopped |
Recording has stopped. |
recordingVolumeChanged |
The volume of speech has changed. |