@qvac/decoder-audio 0.2.8 → 0.2.9

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.
@@ -243,8 +243,10 @@ class FFmpegDecoder extends BaseInference {
243
243
  )
244
244
  samples.fill(output)
245
245
 
246
- while (resampler.flush(output) > 0) {
247
- const chunk = Buffer.from(samples.data)
246
+ let flushCount
247
+ while ((flushCount = resampler.flush(output)) > 0) {
248
+ const actualLength = OUTPUT_FORMAT_BYTE_LENGTH * flushCount * output.channelLayout.nbChannels
249
+ const chunk = Buffer.from(samples.data.subarray(0, actualLength))
248
250
  job.response.updateOutput({ outputArray: chunk })
249
251
  }
250
252
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@qvac/decoder-audio",
3
- "version": "0.2.8",
3
+ "version": "0.2.9",
4
4
  "description": "",
5
5
  "license": "Apache-2.0",
6
6
  "author": "Tether",
@@ -7,7 +7,7 @@
7
7
  ],
8
8
  "current_versions": [
9
9
  {
10
- "version": "0.2.8"
10
+ "version": "0.2.9"
11
11
  }
12
12
  ],
13
13
  "exported_symbols": [
@@ -7,7 +7,7 @@
7
7
  ],
8
8
  "current_versions": [
9
9
  {
10
- "version": "0.2.8"
10
+ "version": "0.2.9"
11
11
  }
12
12
  ],
13
13
  "exported_symbols": [
@@ -7,7 +7,7 @@
7
7
  ],
8
8
  "current_versions": [
9
9
  {
10
- "version": "0.2.8"
10
+ "version": "0.2.9"
11
11
  }
12
12
  ],
13
13
  "exported_symbols": [
@@ -7,7 +7,7 @@
7
7
  ],
8
8
  "current_versions": [
9
9
  {
10
- "version": "0.2.8"
10
+ "version": "0.2.9"
11
11
  }
12
12
  ],
13
13
  "exported_symbols": [