whispermix 1.2.2 → 1.2.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.
- package/index.js +3 -1
- package/package.json +1 -1
package/index.js
CHANGED
|
@@ -2,6 +2,7 @@ const axios = require('axios');
|
|
|
2
2
|
const FormData = require('form-data');
|
|
3
3
|
const fs = require('fs');
|
|
4
4
|
const Bottleneck = require('bottleneck');
|
|
5
|
+
const path = require('path');
|
|
5
6
|
|
|
6
7
|
class WhisperMix {
|
|
7
8
|
constructor(setup = {}) {
|
|
@@ -34,7 +35,8 @@ class WhisperMix {
|
|
|
34
35
|
}
|
|
35
36
|
|
|
36
37
|
async fromFile(filePath) {
|
|
37
|
-
|
|
38
|
+
const absolutePath = path.resolve(filePath);
|
|
39
|
+
return this.fromStream(fs.createReadStream(absolutePath));
|
|
38
40
|
}
|
|
39
41
|
|
|
40
42
|
async fromStream(audioStream) {
|
package/package.json
CHANGED