feat: support audio/mpeg for podcast and tts
This commit is contained in:
@ -86,7 +86,7 @@ app.get("/podcast_audio/*", async (c) => {
|
|||||||
const file = Bun.file(audioFilePath);
|
const file = Bun.file(audioFilePath);
|
||||||
if (await file.exists()) {
|
if (await file.exists()) {
|
||||||
const blob = await file.arrayBuffer();
|
const blob = await file.arrayBuffer();
|
||||||
return c.body(blob, 200, { "Content-Type": "audio/wav" });
|
return c.body(blob, 200, { "Content-Type": "audio/mpeg" });
|
||||||
}
|
}
|
||||||
return c.notFound();
|
return c.notFound();
|
||||||
});
|
});
|
||||||
|
@ -38,7 +38,7 @@ export async function updatePodcastRSS() {
|
|||||||
<category>${channelCategories}</category>
|
<category>${channelCategories}</category>
|
||||||
<language>${channelLanguage}</language>
|
<language>${channelLanguage}</language>
|
||||||
<ttl>${channelTTL}</ttl>
|
<ttl>${channelTTL}</ttl>
|
||||||
<enclosure url="${fileUrl}" length="${fileSize}" type="audio/wav" />
|
<enclosure url="${fileUrl}" length="${fileSize}" type="audio/mpeg" />
|
||||||
<guid>${fileUrl}</guid>
|
<guid>${fileUrl}</guid>
|
||||||
<pubDate>${pubDate}</pubDate>
|
<pubDate>${pubDate}</pubDate>
|
||||||
</item>
|
</item>
|
||||||
|
@ -86,5 +86,9 @@ export async function generateTTS(
|
|||||||
.save(mp3FilePath);
|
.save(mp3FilePath);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// Wavファイルを削除
|
||||||
|
fs.unlinkSync(wavFilePath);
|
||||||
|
console.log(`TTS生成完了: ${itemId}`);
|
||||||
|
|
||||||
return path.basename(mp3FilePath);
|
return path.basename(mp3FilePath);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user