diff --git a/frontend/src/components/EpisodePlayer.tsx b/frontend/src/components/EpisodePlayer.tsx index 460b6ef..743a99c 100644 --- a/frontend/src/components/EpisodePlayer.tsx +++ b/frontend/src/components/EpisodePlayer.tsx @@ -13,6 +13,7 @@ export default function EpisodePlayer() { const [selectedEpisode, setSelectedEpisode] = useState(null); const [audioUrl, setAudioUrl] = useState(null); const [loading, setLoading] = useState(true); + const [isPlaying, setIsPlaying] = useState(false); const [error, setError] = useState(null); useEffect(() => { diff --git a/server.ts b/server.ts index 968045f..2ea1cf8 100644 --- a/server.ts +++ b/server.ts @@ -70,7 +70,7 @@ app.get("/assets/*", async (c) => { : filePath.endsWith(".css") ? "text/css" : "application/octet-stream"; - const blob = await file.blob(); + const blob = await file.arrayBuffer(); return c.body(blob, 200, { "Content-Type": contentType }); } return c.notFound(); diff --git a/services/tts.ts b/services/tts.ts index d7d53c2..8d83ed9 100644 --- a/services/tts.ts +++ b/services/tts.ts @@ -1,6 +1,5 @@ import fs from "fs"; import path from "path"; -import fetch from "node-fetch"; // VOICEVOX APIの設定 const VOICEVOX_HOST = "http://localhost:50021"; @@ -54,7 +53,8 @@ export async function generateTTS( throw new Error("VOICEVOX 音声合成に失敗しました"); } - const audioBuffer = await audioResponse.buffer(); + const audioArrayBuffer = await audioResponse.arrayBuffer(); + const audioBuffer = Buffer.from(audioArrayBuffer); // 出力ディレクトリの準備 const outputDir = path.join(__dirname, "../public/podcast_audio");