@sebastianappelberg/transcriber
v0.0.2
Published
TTS with VAD
Maintainers
Readme
Transcriber
Motivation
TTS with VAD comes in handy in more than one project. Therefore, I want to wrap it into a re-usable package.
Usage
const {wait, proceed} = createWaitProceedSignal();
const transcriber = new Transcriber({
transcriptionClient: new GoogleTranscriptionClient(),
onMessage: async message => {
console.log(message);
},
onError: async error => {
console.error(error);
}
});
console.log("Recording");
transcriber.start();
const handleExit = () => {
transcriber.stop();
process.off("SIGINT", handleExit);
process.off("SIGTERM", handleExit);
proceed();
};
process.on("SIGINT", handleExit);
process.on("SIGTERM", handleExit);
await wait;
console.log("Stopped");If you don't want to pass the API key in the TranscriptionClient's constructor you can set the following environment variables:
- For Groq: GROQ_API_KEY
- For OpenAI: OPENAI_API_KEY
- For Google: GEMINI_API_KEY
License
This project is licensed under the MIT License. See the LICENSE file for details.
