This commit is contained in:
2025-06-08 16:35:06 +09:00
parent 230b3558b9
commit be026db3d8
20 changed files with 182 additions and 73 deletions

View File

@@ -7,7 +7,7 @@ import { config } from "./config.js";
* Split text into natural chunks for TTS processing
* Aims for approximately 50 characters per chunk, breaking at natural points
*/
function splitTextIntoChunks(text: string, maxLength: number = 50): string[] {
function splitTextIntoChunks(text: string, maxLength = 50): string[] {
if (text.length <= maxLength) {
return [text];
}
@@ -242,7 +242,7 @@ async function concatenateAudioFiles(
export async function generateTTSWithoutQueue(
itemId: string,
scriptText: string,
retryCount: number = 0,
retryCount = 0,
): Promise<string> {
if (!itemId || itemId.trim() === "") {
throw new Error("Item ID is required for TTS generation");
@@ -337,7 +337,7 @@ export async function generateTTSWithoutQueue(
export async function generateTTS(
itemId: string,
scriptText: string,
retryCount: number = 0,
retryCount = 0,
): Promise<string> {
const maxRetries = 2;