recorder-client 1.0.2 → 1.0.4

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 +28 -23
  2. package/package.json +4 -4
package/README.md CHANGED
@@ -14,29 +14,34 @@ npm i recorder-client
14
14
 
15
15
  ### API
16
16
 
17
- | property | type | description | default |
18
- | :-------------: | :-----------------------: | :-------------------------------------------------------------------------: | :-------: |
19
- | sampleRate | number | audio sampling rate | undefined |
20
- | chunkSize | number | number of samples in the audio data block (length of the audio buffer zone) | undefined |
21
- | ignoreMute | boolean | ignore mute | undefined |
22
- | ondataavailable | (pcm: Int16Array) => void | real-time audio data | undefined |
23
- | onpause | () => void | pause event | undefined |
24
- | onresume | () => void | resume event | undefined |
25
- | onstart | () => void | start event | undefined |
26
- | onstop | (wav: Blob) => void | stop event | undefined |
27
- | pause | () => void | audio pause | undefined |
28
- | resume | () => void | audio resume | undefined |
29
- | start | () => void | audio start | undefined |
30
- | stop | () => void | audio stop | undefined |
17
+ | property | type | description | default |
18
+ | :--------: | :-----: | :-------------------------------------------------------------------------: | :-------: |
19
+ | sampleRate | number | audio sampling rate | undefined |
20
+ | chunkSize | number | number of samples in the audio data block (length of the audio buffer zone) | undefined |
21
+ | ignoreMute | boolean | ignore mute | undefined |
22
+
23
+ ### Event
24
+
25
+ | property | type | description |
26
+ | :-------------: | :-----------------------: | :------------------: |
27
+ | ondataavailable | (pcm: Int16Array) => void | real-time audio data |
28
+ | onpause | () => void | pause event |
29
+ | onresume | () => void | resume event |
30
+ | onstart | () => void | start event |
31
+ | onstop | (pcm: Int16Array) => void | stop event |
32
+ | pause | () => void | audio pause |
33
+ | resume | () => void | audio resume |
34
+ | start | () => void | audio start |
35
+ | stop | () => void | audio stop |
31
36
 
32
37
  ### Helper
33
38
 
34
- | property | type | description |
35
- | :--------: | :----------------------------------------------: | :-----------------------------------: |
36
- | pcmMerge | (pcms: Int16Array[]) => Int16Array<ArrayBuffer> | merge multiple pcm streams |
37
- | pcmToWav | (pcm: Int16Array, sampleRate: number) => Blob | convert PCM to WAV |
38
- | parseWav | (buffer: ArrayBuffer) => object | obtain information about the wav file |
39
- | isSpeaking | (pcm: Int16Array, sampleRate: number) => boolean | check if there is any input of audio |
39
+ | property | type | description |
40
+ | :------: | :----------------------------------------------: | :-----------------------------------: |
41
+ | pcmMerge | (pcms: Int16Array[]) => Int16Array | merge multiple pcm streams |
42
+ | pcmToWav | (pcm: Int16Array, sampleRate: number) => Blob | convert PCM to WAV |
43
+ | parseWav | (buffer: ArrayBuffer) => object | obtain information about the wav file |
44
+ | isSpeak | (pcm: Int16Array, sampleRate: number) => boolean | check if there is any input of audio |
40
45
 
41
46
  ### Example
42
47
 
@@ -81,7 +86,7 @@ recorder.ondataavailable = (pcm) => {
81
86
  };
82
87
 
83
88
  const onMerge = () => {
84
- return Recorder.pcmMerge(pcms);
89
+ const data = Recorder.pcmMerge(pcms);
85
90
  };
86
91
  ```
87
92
 
@@ -119,7 +124,7 @@ const getWav = async (file: File) => {
119
124
  };
120
125
  ```
121
126
 
122
- > isSpeaking
127
+ > isSpeak
123
128
 
124
129
  ```ts
125
130
  import { Recorder } from 'recorder-client';
@@ -130,6 +135,6 @@ const recorder = new Recorder({
130
135
  });
131
136
 
132
137
  recorder.ondataavailable = (pcm) => {
133
- const flag = Recorder.isSpeaking(pcm, 16000);
138
+ const flag = Recorder.isSpeak(pcm, 16000);
134
139
  };
135
140
  ```
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "recorder-client",
3
- "version": "1.0.2",
3
+ "version": "1.0.4",
4
4
  "description": "audio recording client",
5
5
  "type": "module",
6
6
  "main": "dist/index.cjs.js",
@@ -31,11 +31,11 @@
31
31
  "@rollup/plugin-typescript": "^12.1.4",
32
32
  "@types/node": "^24.3.0",
33
33
  "happy-dom": "^18.0.1",
34
- "rollup": "^4.47.1",
34
+ "rollup": "^4.48.0",
35
35
  "rollup-plugin-dts": "^6.2.3",
36
36
  "tslib": "^2.8.1",
37
- "typescript": "^5.8.3",
38
- "typescript-eslint-standard": "^9.59.0",
37
+ "typescript": "^5.9.2",
38
+ "typescript-eslint-standard": "^9.60.0",
39
39
  "vitest": "^3.2.4"
40
40
  },
41
41
  "author": "mivui",