Skip to content

Error maximum size and transcribing #104

Closed

Description

@christoic

Hi,

Congrats for your work !

I am expecting an error after choosing the option "Transcribe the current episode": The storage file has been changed but exceeds the maximum size. Skipping: [path of the file as defined in settings]

The transcribe notes is created at the end of the process but 3 links in the content (below the title, podcast and Date --- following the default template):

[Error transcribing chunk 0] [Error transcribing chunk 1] [Error transcribing chunk 2]

The API key has been keyed in.
Btw is it possible to add the API path as well in the settings as I am using https://openrouter.ai/

Thank you again for your great work !

Activity

  1. christoic commented on Jul 22, 2024

    @christoic
    Author

    Erratum : work with my android phone...not with my Windows 10 PC

  2. chhoumann commented on Jun 15, 2026

    @chhoumann
    Owner

    Thanks for the detailed report — and sorry for the long delay. I went back through this against current master and the "maximum size" failure you hit has since been fixed, by two independent changes that landed after this issue was filed. Closing as resolved, with evidence below.

    What was going wrong (Jul 2024)

    Your report had two symptoms, with two different root causes:

    1. The storage file has been changed but exceeds the maximum size. Skipping: [path] — this is an Obsidian Sync message. The old transcription flow downloaded the full episode into the vault (vault.createBinary) before transcribing, so Sync tried to sync a large audio file and rejected it.
    2. [Error transcribing chunk 0] [Error transcribing chunk 1] [Error transcribing chunk 2] — the fallback strings emitted when every OpenAI request failed. The whole, undivided episode was sent in one request, and OpenAI's Whisper API rejects any single request whose audio file exceeds 25 MB.

    Why it's fixed on current master

    1. Every OpenAI request is now capped at 20 MB (under the 25 MB limit).
    Audio is split into chunks before transcription. The cap is CHUNK_SIZE_BYTES = 20 * 1024 * 1024 (src/services/TranscriptionService.ts:56), and it's enforced on the only request site, client.audio.transcriptions.create (src/services/TranscriptionService.ts:434), which is fed exclusively by createChunkFiles:

    • Binary path — createBinaryChunkFiles (:219-248): returns a single file only when the buffer is <= 20 MB, otherwise slices at exact 20 MB boundaries.
    • m4a → WAV path — renderWavChunks (:288-326): bounds each WAV file at WAV_HEADER_SIZE + sampleCount * blockAlign <= 20 MB, including the PCM expansion. (Mono/stereo/4-channel all compute to ≤ 20,971,520 bytes.)
    • If WAV decoding fails, it falls back to the 20 MB binary chunker (:204-211), so no path bypasses the cap.

    So no single request can exceed ~20 MB — about 4 MB under the 25 MB limit, which comfortably covers multipart overhead. Chunking was introduced in #128.

    2. Transcription no longer writes the audio into the vault.
    The transcription flow now fetches audio into memory via getEpisodeAudioBuffer (src/downloadEpisode.ts:397): "the episode's own stream URL is fetched into memory. Nothing is written to the vault" (:394-395). The only vault.createBinary call (src/downloadEpisode.ts:223) lives in createEpisodeFile, used solely by the Download command — not by transcription. So the Sync size-rejection from symptom (1) can no longer be triggered by transcribing. This landed in #182 (the fix for #107).

    Verification

    • TranscriptionService unit tests pass (11/11), including the chunk-splitting tests.
    • I ran an adversarial review specifically trying to construct an input (large/stereo/high-sample-rate episode, decode-failure fallback, un-chunked path) that still produces a >25 MB request or a transcription-time vault write — none exists.

    On your OpenRouter / API-path request

    Btw is it possible to add the API path as well in the settings as I am using https://openrouter.ai/

    That's a great idea, but it's a separate enhancement from this "max size" bug — the OpenAI client is currently constructed with no configurable baseURL (src/services/TranscriptionService.ts:530), so an OpenRouter key won't work today regardless of file size. There isn't an open issue for it yet; if you'd still like a configurable transcription endpoint, please open a dedicated feature request and we'll track it there. (Note: OpenRouter would also need to expose a Whisper-compatible audio/transcriptions endpoint for it to work end-to-end.)

    Thanks again for the kind words and the report. 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions