mirror of
https://github.com/jambonz/batch-speech-utils.git
synced 2026-07-05 03:41:59 +00:00
18 lines
488 B
JavaScript
18 lines
488 B
JavaScript
const assert = require('assert');
|
|
const {transcribe:dgTranscribe} = require('./deepgram');
|
|
|
|
|
|
const transcribe = async(logger, credentials, filePath) => {
|
|
const { vendor } = credentials;
|
|
|
|
switch (credentials.vendor) {
|
|
case 'deepgram':
|
|
assert.ok(credentials.apiKey, 'Deepgram API key is required');
|
|
return await dgTranscribe(logger, credentials.apiKey, filePath);
|
|
default:
|
|
throw new Error(`Unsupported vendor: ${vendor}`);
|
|
}
|
|
};
|
|
|
|
module.exports = transcribe;
|