feat: Move VOICEVOX settings to .env
This commit is contained in:
@ -2,17 +2,19 @@ import fs from "fs";
|
|||||||
import path from "path";
|
import path from "path";
|
||||||
|
|
||||||
// VOICEVOX APIの設定
|
// VOICEVOX APIの設定
|
||||||
const VOICEVOX_HOST = "http://localhost:50021";
|
const VOICEVOX_HOST = process.env.VOICEVOX_HOST ?? "http://localhost:50021";
|
||||||
|
const VOICEVOX_SPEAKER_ID = parseInt(process.env.VOICEVOX_SPEAKER_ID ?? "3");
|
||||||
|
const VOICEVOX_STYLE_ID = parseInt(process.env.VOICEVOX_STYLE_ID ?? "2");
|
||||||
|
|
||||||
interface VoiceStyle {
|
interface VoiceStyle {
|
||||||
speakerId: number;
|
speakerId: number;
|
||||||
styleId: number;
|
styleId: number;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 仮の声設定(例: サイドM = 3)
|
// 環境変数からデフォルトの声設定を取得
|
||||||
const defaultVoiceStyle: VoiceStyle = {
|
const defaultVoiceStyle: VoiceStyle = {
|
||||||
speakerId: 3,
|
speakerId: VOICEVOX_SPEAKER_ID,
|
||||||
styleId: 2,
|
styleId: VOICEVOX_STYLE_ID,
|
||||||
};
|
};
|
||||||
|
|
||||||
export async function generateTTS(
|
export async function generateTTS(
|
||||||
|
Reference in New Issue
Block a user