INNER CODE UNIT · TypeScript

count

iurysza/module-graph · .agents/skills/audio-transcribe/scripts/transcribe.ts:125

  const count = Math.ceil(duration / chunkSeconds);
  if (count <= 1) {
    return [{ path: normalizedPath, offsetSeconds: 0, durationSeconds: duration }];
  }

  console.log(`Splitting into ${count} chunks of at most ${chunkMinutes} minutes...`);
  const chunks: AudioChunk[] = [];
  for (let index = 0; index < count; index += 1) {
    const offsetSeconds = index * chunkSeconds;
    const chunkPath = join(workDir, `chunk-${String(index + 1).padStart(3, "0")}.mp3`);
    const result = await run([
      "ffmpeg",
      "-y",
      "-i",
      normalizedPath,
      "-ss",
      String(offsetSeconds),
      "-t",

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…