feat: fix TypeScript errors and improve code quality

This commit is contained in:
2025-06-04 11:30:12 +09:00
parent a93cfd201d
commit 56320f125b
3 changed files with 4 additions and 3 deletions

View File

@ -13,6 +13,7 @@ export default function EpisodePlayer() {
const [selectedEpisode, setSelectedEpisode] = useState<Episode | null>(null);
const [audioUrl, setAudioUrl] = useState<string | null>(null);
const [loading, setLoading] = useState(true);
const [isPlaying, setIsPlaying] = useState(false);
const [error, setError] = useState<string | null>(null);
useEffect(() => {

View File

@ -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();

View File

@ -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");