mirror of
https://github.com/jambonz/batch-speech-utils.git
synced 2026-11-10 11:51:49 +00:00
restructure
This commit is contained in:
1 parent
f74bbd4f45
commit
4aea7128b1
8 files changed
+82
-146
No files matched your search
@@ -0,0 +1,3 @@
|
||||
module.exports = {
|
||||
transcribe: require('./transcribe')
|
||||
};
|
||||
@@ -0,0 +1,13 @@
|
||||
const fs = require('fs');
|
||||
const { createClient } = require('@deepgram/sdk');
|
||||
|
||||
const transcribe = async(logger, apiKey, filePath) => {
|
||||
logger.info(`Transcribing audio file: ${filePath}`);
|
||||
const client = createClient(apiKey);
|
||||
const fileBuffer = fs.readFileSync(filePath);
|
||||
const options = { model: 'nova-2', smart_format: true, detect_entities: true };
|
||||
const { result } = await client.listen.prerecorded.transcribeFile(fileBuffer, options);
|
||||
return result;
|
||||
};
|
||||
|
||||
module.exports = transcribe;
|
||||
Reference in new issue
Block a user