diff --git a/acosta.wav b/acosta.wav deleted file mode 100644 index 2751ce4..0000000 Binary files a/acosta.wav and /dev/null differ diff --git a/assets/speech/news-alloy-alt.wav b/assets/speech/news-alloy-alt.wav new file mode 100644 index 0000000..bba7d58 Binary files /dev/null and b/assets/speech/news-alloy-alt.wav differ diff --git a/assets/speech/news-alloy.wav b/assets/speech/news-alloy.wav new file mode 100644 index 0000000..e1d705e Binary files /dev/null and b/assets/speech/news-alloy.wav differ diff --git a/assets/speech/news-fable.wav b/assets/speech/news-fable.wav new file mode 100644 index 0000000..a7f3976 Binary files /dev/null and b/assets/speech/news-fable.wav differ diff --git a/assets/speech/news-nova.wav b/assets/speech/news-nova.wav new file mode 100644 index 0000000..f70e2a7 Binary files /dev/null and b/assets/speech/news-nova.wav differ diff --git a/assets/speech/news-onyx.wav b/assets/speech/news-onyx.wav new file mode 100644 index 0000000..7b9f1fb Binary files /dev/null and b/assets/speech/news-onyx.wav differ diff --git a/assets/speech/news-shimmer.wav b/assets/speech/news-shimmer.wav new file mode 100644 index 0000000..c0d68f8 Binary files /dev/null and b/assets/speech/news-shimmer.wav differ diff --git a/assets/speech/speech-script b/assets/speech/speech-script new file mode 100644 index 0000000..23ed0fd --- /dev/null +++ b/assets/speech/speech-script @@ -0,0 +1 @@ +Hello. My name is Shimmer. I am one of the voices that ships with Opened AI Speech, and I'm happy to read the news for you today. \ No newline at end of file diff --git a/package.json b/package.json index 9b47700..1fb2366 100644 --- a/package.json +++ b/package.json @@ -9,6 +9,7 @@ "web-dev": "nodemon ./src/newsroom-web.ts", "start-worker": "node --import ./register.js --no-warnings ./src/workers/newsroom.ts", "worker-dev": "nodemon ./src/workers/newsroom.ts", + "speechgen": "node --import ./register.js --no-warnings ./src/speechgen.ts", "test": "echo \"Error: no test specified\" && exit 1" }, "keywords": [ diff --git a/robc.wav b/robc.wav deleted file mode 100644 index 259a6d0..0000000 Binary files a/robc.wav and /dev/null differ diff --git a/src/app/services/openai.ts b/src/app/services/openai.ts index 9ac7c6e..13a4280 100644 --- a/src/app/services/openai.ts +++ b/src/app/services/openai.ts @@ -40,6 +40,7 @@ export class OpenAiService extends DtpService { }); this.homelabClient = new OpenAI({ baseURL: env.apis.openai.homelab.baseURL, + apiKey: "unused", }); } @@ -138,12 +139,14 @@ export class OpenAiService extends DtpService { async generateSpeech (input: string, model: string, voice: SpeechVoice) : Promise { const audioId = new Types.ObjectId(); - const audioFile = path.join(env.root, audioId.toString()); + const audioFile = path.join(env.root, `${audioId.toString()}.wav`); const response = await this.homelabClient.audio.speech.create({ input, model, - voice + voice, + response_format: "wav", + speed: 1.0, }); if (!response.ok) { throw new WebError(response.status, `failed to generate speech audio: ${response.statusText}`); diff --git a/src/speechgen.ts b/src/speechgen.ts index 03e56b9..680b671 100644 --- a/src/speechgen.ts +++ b/src/speechgen.ts @@ -39,6 +39,7 @@ class SpeechGenerator extends DtpProcess { try { console.log("Speech Generator: A command line tool to generate audio"); const generator = new SpeechGenerator(); + await generator.start(); const model = process.argv[2]; assert(model, "Must specify model (tts-1, tts-1-hd)");