@corti/dictation-web 0.1.19-rc.1 → 0.1.20-rc
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +13 -12
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,14 +1,14 @@
|
|
|
1
|
-
# Corti Dictation
|
|
1
|
+
# Corti Dictation Web Component
|
|
2
2
|
|
|
3
3
|
## Overview
|
|
4
4
|
|
|
5
|
-
The **Corti Dictation
|
|
5
|
+
The **Corti Dictation Web Component** is a web component that enables real-time speech-to-text dictation using Corti's Dictation API. It provides a simple interface for capturing audio, streaming it to the API, and handling transcripts.
|
|
6
6
|
|
|
7
|
-
> **Note:** OAuth 2.0 authentication is not handled by this
|
|
7
|
+
> **Note:** OAuth 2.0 authentication is not handled by this library. The client must provide an API key or authorization token before using the component.
|
|
8
8
|
|
|
9
9
|
## Installation
|
|
10
10
|
|
|
11
|
-
Include the
|
|
11
|
+
Include the Web Component in your project by importing the JavaScript module:
|
|
12
12
|
|
|
13
13
|
```html
|
|
14
14
|
npm i @corti/dictation-web
|
|
@@ -17,7 +17,7 @@ npm i @corti/dictation-web
|
|
|
17
17
|
Then import the module like so:
|
|
18
18
|
|
|
19
19
|
```js
|
|
20
|
-
// Import the Corti Dictation
|
|
20
|
+
// Import the Corti Dictation Web Component
|
|
21
21
|
import '@corti/dictation-web';
|
|
22
22
|
```
|
|
23
23
|
|
|
@@ -43,7 +43,7 @@ Alternatively, use a CDN to start quickly (not recommended).
|
|
|
43
43
|
<!DOCTYPE html>
|
|
44
44
|
<html lang="en">
|
|
45
45
|
<body>
|
|
46
|
-
<corti-dictation></corti-dictation>
|
|
46
|
+
<corti-dictation id="dictation"></corti-dictation>
|
|
47
47
|
<textarea
|
|
48
48
|
id="transcript"
|
|
49
49
|
placeholder="Transcript will appear here..."
|
|
@@ -51,9 +51,10 @@ Alternatively, use a CDN to start quickly (not recommended).
|
|
|
51
51
|
|
|
52
52
|
<script>
|
|
53
53
|
import '@corti/dictation-web';
|
|
54
|
-
const
|
|
55
|
-
|
|
56
|
-
|
|
54
|
+
const dictationEl = document.getElementById('dictation');
|
|
55
|
+
dictationEl.addEventListener('ready', () => {
|
|
56
|
+
dictationEl.setAccessToken('YOUR_AUTH_TOKEN'); // Note: Never hardcode tokens
|
|
57
|
+
});
|
|
57
58
|
dictationEl.addEventListener('transcript', e => {
|
|
58
59
|
document.getElementById('transcript').value += e.detail.data.text + ' ';
|
|
59
60
|
});
|
|
@@ -72,7 +73,7 @@ Alternatively, use a CDN to start quickly (not recommended).
|
|
|
72
73
|
| `selectedDevice` | Object | The selected device used for recording (MediaDeviceInfo). |
|
|
73
74
|
| `recordingState` | String | Current state of recording (`stopped`, `recording`, `initializing` and `stopping`, ). |
|
|
74
75
|
| `dictationConfig` | Object | Configuration settings for dictation. |
|
|
75
|
-
| `languagesSupported` | String[] | List of all language codes available for use on the
|
|
76
|
+
| `languagesSupported` | String[] | List of all language codes available for use on the Web Component. |
|
|
76
77
|
| `debug_displayAudio` | Boolean | Overrides any device selection and instead uses getDisplayMedia to stream system audio. Should only be used for debugging |
|
|
77
78
|
|
|
78
79
|
### Methods
|
|
@@ -96,7 +97,7 @@ Alternatively, use a CDN to start quickly (not recommended).
|
|
|
96
97
|
|
|
97
98
|
## Authentication
|
|
98
99
|
|
|
99
|
-
This
|
|
100
|
+
This library does not handle OAuth 2.0 authentication. The client must provide an API key or access token as a string using `setAccessToken`.
|
|
100
101
|
|
|
101
102
|
## Usage Examples
|
|
102
103
|
|
|
@@ -110,7 +111,7 @@ The default UI is designed to be slotted into existing applications seamlessly,
|
|
|
110
111
|
|
|
111
112
|
## License
|
|
112
113
|
|
|
113
|
-
This
|
|
114
|
+
This Web Component library is licensed under MIT.
|
|
114
115
|
|
|
115
116
|
## Support
|
|
116
117
|
|