@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.
Files changed (2) hide show
  1. package/README.md +16 -4
  2. package/package.json +1 -1
package/README.md CHANGED
@@ -1,5 +1,10 @@
1
1
  # Audio Worklet Stream Library
2
2
 
3
+ [![npm version](https://badge.fury.io/js/@ain1084%2Faudio-worklet-stream.svg)](https://badge.fury.io/js/@ain1084%2Faudio-worklet-stream)
4
+ [![Documentation](https://github.com/ain1084/audio-worklet-stream/workflows/docs/badge.svg)](https://github.com/ain1084/audio-worklet-stream/actions?query=workflow%3Adocs)
5
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
6
+ [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](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 the MIT License. See the [LICENSE](./LICENSE) file for details.
248
+ This project is licensed under multiple licenses:
249
+
250
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
251
+ [![License](https://img.shields.io/badge/License-Apache_2.0-blue.svg)](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.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ain1084/audio-worklet-stream",
3
- "version": "0.1.2",
3
+ "version": "0.1.3",
4
4
  "main": "dist/index.js",
5
5
  "module": "dist/index.js",
6
6
  "types": "dist/index.d.ts",