feat: fix TypeScript errors and improve code quality
This commit is contained in:
@ -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(() => {
|
||||
|
@ -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();
|
||||
|
@ -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");
|
||||
|
Reference in New Issue
Block a user