whispermix 1.0.8 → 1.1.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/README.md CHANGED
@@ -37,7 +37,7 @@ const whisperGroq = new WhisperMix({ model: 'whisper-large-v3' }); // For Groq's
37
37
 
38
38
  ```javascript
39
39
  const filePath = 'path/to/your/audio/file.mp3';
40
- whisperGroq.fromVoiceFile(filePath)
40
+ whisperGroq.fromFile(filePath)
41
41
  .then(transcription => console.log(transcription))
42
42
  .catch(error => console.error(error));
43
43
  ```
@@ -48,7 +48,7 @@ whisperGroq.fromVoiceFile(filePath)
48
48
  const fs = require('fs');
49
49
  const audioStream = fs.createReadStream('path/to/your/audio/file.mp3');
50
50
 
51
- whisperGroq.fromVoiceStream(audioStream)
51
+ whisperGroq.fromStream(audioStream)
52
52
  .then(transcription => console.log(transcription))
53
53
  .catch(error => console.error(error));
54
54
  ```
@@ -61,7 +61,7 @@ Creates a new WhisperMix instance.
61
61
 
62
62
  - `options.model`: The model to use for transcription. Can be 'whisper-1' (OpenAI) or 'whisper-large-v3' (Groq).
63
63
 
64
- ### `whisper.fromVoiceFile(filePath)`
64
+ ### `whisper.fromFile(filePath)`
65
65
 
66
66
  Transcribes audio from a file.
67
67
 
@@ -69,7 +69,7 @@ Transcribes audio from a file.
69
69
 
70
70
  Returns a Promise that resolves with the transcription text.
71
71
 
72
- ### `whisper.fromVoiceStream(audioStream)`
72
+ ### `whisper.fromStream(audioStream)`
73
73
 
74
74
  Transcribes audio from a stream.
75
75
 
package/demo/groq.js CHANGED
@@ -1,9 +1,10 @@
1
1
  require('dotenv').config();
2
2
  const WhisperMix = require('../index.js')
3
3
 
4
+
4
5
  const transcribe = new WhisperMix({ model: 'whisper-large-v3' });
5
6
 
6
7
  main(); async function main() {
7
- const r = await transcribe.fromVoiceFile('./example.mp3');
8
+ const r = await transcribe.fromFile('./example.mp3');
8
9
  console.log(r)
9
10
  }
package/index.js CHANGED
@@ -3,7 +3,7 @@ const FormData = require('form-data');
3
3
  const fs = require('fs');
4
4
 
5
5
  class WhisperMix {
6
-
6
+
7
7
  constructor(setup = { model: 'whisper-1' }) {
8
8
  const config = {
9
9
  'whisper-1': {
@@ -24,11 +24,11 @@ class WhisperMix {
24
24
  this.apiUrl = config[this.model].url;
25
25
  }
26
26
 
27
- async fromVoiceFile(filePath) {
28
- return this.fromVoiceStream(fs.createReadStream(filePath));
27
+ async fromFile(filePath) {
28
+ return this.fromStream(fs.createReadStream(filePath));
29
29
  }
30
30
 
31
- async fromVoiceStream(audioStream) {
31
+ async fromStream(audioStream) {
32
32
  return new Promise((resolve, reject) => {
33
33
  const formData = new FormData();
34
34
  formData.append('file', audioStream);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "whispermix",
3
- "version": "1.0.8",
3
+ "version": "1.1.4",
4
4
  "keywords": [
5
5
  "whisper",
6
6
  "openai",