geminisst 1.0.0 → 1.0.1
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.
Potentially problematic release.
This version of geminisst might be problematic. Click here for more details.
- package/dist/index.js +6 -2
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -10,9 +10,13 @@ import { bufferToBase64 } from './utils.js';
|
|
|
10
10
|
* @returns The transcription result object containing text and thoughts
|
|
11
11
|
*/
|
|
12
12
|
export async function audioToText(audioFile, apiKey, options = {}) {
|
|
13
|
-
// 1.
|
|
13
|
+
// 1. Validate Audio File Path
|
|
14
14
|
if (!fs.existsSync(audioFile)) {
|
|
15
|
-
throw new Error(`Audio file not found: ${audioFile}`);
|
|
15
|
+
throw new Error(`[geminisst] Audio file not found at path: ${audioFile}`);
|
|
16
|
+
}
|
|
17
|
+
const stats = fs.statSync(audioFile);
|
|
18
|
+
if (stats.isDirectory()) {
|
|
19
|
+
throw new Error(`[geminisst] Expected a file path but found a directory: ${audioFile}`);
|
|
16
20
|
}
|
|
17
21
|
// Simple mime type detection based on extension
|
|
18
22
|
const ext = path.extname(audioFile).toLowerCase().replace('.', '');
|