[Python] RuntimeError when transcribing audio using whisper.cpp with WebAssembly in browser

Discussão em 'Python' iniciado por Stack, Junho 21, 2025.

  1. Stack

    Stack Membro Participativo

    I'm trying to run whisper.cpp compiled to WebAssembly (whisper.wasm) locally in my browser on macOS. The goal is to record audio using the microphone, transcribe it using a base model, and get the results client-side.

    Environment

    • macOS
    • Browser: (e.g., Chrome)
    • Installed tools:

    brew install emscripten
    brew install libomp
    export OpenMP_ROOT=$(brew --prefix)/opt/libomp

    Steps to Reproduce


    git clone https://github.com/ggml-org/whisper.cpp
    cd whisper.cpp
    mkdir build-em && cd build-em
    emcmake cmake ..
    make -j
    cd bin
    python3 -m http.server


    Then I open http://localhost:8000/whisper.wasm/, and:

    1. Download a base model (e.g., base.en).
    2. Record audio via the microphone saying: “hello, testing testing”.
    3. Click the “Transcribe” button.
    Problem


    At the transcription step, I get the following error in the browser console:

    main.js:1 Uncaught RuntimeError: Aborted(). Build with -sASSERTIONS for more info.
    at abort (main.js:1:6458)
    at __abort_js (main.js:1:1363067)
    at 003b63c6:0x77ca
    at 003b63c6:0x415b
    at 003b63c6:0xc8a30
    at 003b63c6:0xc8b1a
    at Object.full_default (eval at craftInvokerFunction (main.js:1:1), <anonymous>:9:10)
    at whisper.wasm/:647:42

    Question


    What does this RuntimeError: Aborted() mean in the context of running whisper.wasm, and how can I debug or fix it?

    Do I need to rebuild with specific flags (e.g., -sASSERTIONS) or is there a runtime/browser config I might be missing?

    Any insight would be appreciated!

    Continue reading...

Compartilhe esta Página