@ain1084/audio-worklet-stream 0.1.2 → 0.1.3
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 +16 -4
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
# Audio Worklet Stream Library
|
|
2
2
|
|
|
3
|
+
[](https://badge.fury.io/js/@ain1084%2Faudio-worklet-stream)
|
|
4
|
+
[](https://github.com/ain1084/audio-worklet-stream/actions?query=workflow%3Adocs)
|
|
5
|
+
[](https://opensource.org/licenses/MIT)
|
|
6
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
7
|
+
|
|
3
8
|
This library provides a way to work with audio worklets and streams using modern web technologies. It allows for the manual writing of audio frames to a buffer and supports various buffer writing strategies.
|
|
4
9
|
|
|
5
10
|
## Features
|
|
@@ -180,6 +185,7 @@ class Main {
|
|
|
180
185
|
}
|
|
181
186
|
|
|
182
187
|
// Start the audio stream
|
|
188
|
+
// Node’s streaming process (such as timer activation) does not start until start() is called.
|
|
183
189
|
start() {
|
|
184
190
|
if (!this.streamNode) throw new Error('Stream node not created');
|
|
185
191
|
this.streamNode.connect(this.streamNode.context.destination);
|
|
@@ -187,9 +193,10 @@ class Main {
|
|
|
187
193
|
}
|
|
188
194
|
|
|
189
195
|
// Stop the audio stream
|
|
196
|
+
// stop() internally calls node.disconnect(). Since inter-thread communication may take some time, it returns a Promise.
|
|
190
197
|
stop() {
|
|
191
198
|
if (!this.streamNode) throw new Error('Stream node not created');
|
|
192
|
-
this.streamNode.stop();
|
|
199
|
+
return this.streamNode.stop();
|
|
193
200
|
}
|
|
194
201
|
}
|
|
195
202
|
|
|
@@ -236,8 +243,13 @@ We are continuously working on these areas to improve the library. Contributions
|
|
|
236
243
|
|
|
237
244
|
Contributions are welcome! Please open an issue or submit a pull request on GitHub.
|
|
238
245
|
|
|
239
|
-
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
|
|
240
|
-
|
|
241
246
|
## License
|
|
242
247
|
|
|
243
|
-
This project is licensed under
|
|
248
|
+
This project is licensed under multiple licenses:
|
|
249
|
+
|
|
250
|
+
[](https://opensource.org/licenses/MIT)
|
|
251
|
+
[](https://opensource.org/licenses/Apache-2.0)
|
|
252
|
+
|
|
253
|
+
You can choose either license depending on your project needs.
|
|
254
|
+
|
|
255
|
+
Unless you explicitly state otherwise, any contribution intentionally submitted for inclusion in the work by you, as defined in the Apache-2.0 license, shall be dual licensed as above, without any additional terms or conditions.
|