Speech Note Documentation

repository·main·Indexed 23 days ago

https://github.com/mkiol/dsnote

An offline-first application for Linux and Sailfish OS providing local Speech-to-Text (STT), Text-to-Speech (TTS), and Machine Translation (MT) capabilities. It supports multiple engines including Whisper, Vosk, Piper, and Bergamot Translator, ensuring privacy by performing all processing locally. The documentation covers installation via Flatpak, AUR, and various Linux distributions, as well as build instructions for Ubuntu, Arch Linux, Fedora, and Sailfish OS.

Tokens
7.9K
Snippets
13
Records
45
Agent score
81%

What's inside Speech Note

  1. Overview of Speech Note

    main

    Speech Note is a Linux desktop and Sailfish OS application designed for note-taking, reading, and translating. It provides offline capabilities for:

    • Speech to Text (STT): Converting voice to text.
    • Text to Speech (TTS): Converting text to voice.
    • Machine Translation (MT): Translating text between languages.

    All processing is performed locally on your computer without a network connection, ensuring privacy and offline functionality.

  2. How to enable a custom model

    main

    You can enable custom models by editing the models.json configuration file and restarting the application.

    Configuration File Locations:

    • Standard Linux: ~/.local/share/net.mkiol/dsnote/models.json
    • Flatpak: ~/.var/app/net.mkiol.SpeechNote/data/net.mkiol/dsnote/models.json
    • Sailfish OS: ~/.local/share/org.mkiol/dsnote/models.json

    Model JSON Schema:

    {
        "name": "<model name>",
        "model_id": "<model unique id>",
        "engine": "<engine type>",
        "lang_id": "<lang id>",
        "checksum": "<md5 checksum>",
        "checksum_quick": "<partial md5 checksum>",
        "comp": "<compression type",
        "urls": [
            <model URLs>
        ],
        "size": "<download size of all files>"
    }

    Allowed Values:

    • engine: stt_ds, stt_vosk, stt_april, stt_whisper, stt_fasterwhisper, tts_piper, tts_rhvoice, tts_espeak, tts_coqui, tts_mimic3, tts_whisperspeech, tts_sam, tts_parler, tts_f5, tts_kokoro, mnt_bergamot
    • comp: none, gz, xz, tarxz, targz, zip, zipall, dir, dirgz
    • urls: Supports http, https, file

    Generating Checksums: If you are adding a new model, set checksum and checksum_quick to empty strings in the JSON file, then run Speech Note with the --gen-checksums flag to find the correct values.

    flatpak run net.mkiol.SpeechNote --verbose --gen-checksums
    {
        "name": "New Piper Voice",
        "model_id": "en_piper_new",
        "engine": "tts_piper",
        "lang_id": "en",
        "checksum": "",
        "checksum_quick": "",
        "size": ""
        "comp": "dir",
        "urls": [
            "file:///home/me/models/new-model-medium.onnx",
            "file:///home/me/models/new-model-medium.onnx.json"
        ]
    }
  3. Use Subtitles for STT and TTS

    main

    Speech Note supports subtitle workflows:

    • STT (Speech-to-Text): You can convert audio to SRT subtitle format.
    • TTS (Text-to-Speech): Reading aloud from subtitle files is synchronized with timestamps. If configured, the voice speed can automatically adjust to the duration of the subtitle segment, allowing for automated voice-overs.
  4. Build Speech Note as a Flatpak

    main

    Use flatpak-builder to build the base package and the optional NVIDIA add-on.

    Base package:

    git clone <git repository url>
    
    cd dsnote/flatpak
    
    flatpak-builder --force-clean --user --install-deps-from=flathub --repo="<name or /path/to/local/flatpak/repo>" "/path/to/output/dir" net.mkiol.SpeechNote.yaml

    NVIDIA add-on:

    flatpak-builder --force-clean --user --install-deps-from=flathub --repo="<name or /path/to/local/flatpak/repo>" "/path/to/output/dir" net.mkiol.SpeechNote.Addon.nvidia.yaml
    git clone <git repository url>
    
    cd dsnote/flatpak
    
    # build a base package
    flatpak-builder --force-clean --user --install-deps-from=flathub --repo="<name or /path/to/local/flatpak/repo>" "/path/to/output/dir" net.mkiol.SpeechNote.yaml
    
    # build an optional NVIDIA add-on package
    flatpak-builder --force-clean --user --install-deps-from=flathub --repo="<name or /path/to/local/flatpak/repo>" "/path/to/output/dir" net.mkiol.SpeechNote.Addon.nvidia.yaml
  5. Install Speech Note via Flatpak

    main

    Speech Note is available on Flathub. You can install the base package and optional GPU acceleration add-ons depending on your hardware. The base package includes all dependencies for all features, while add-ons provide GPU acceleration (NVIDIA or AMD) to speed up operations.

    Note on Disk Space: Add-on installation requires significant temporary disk space because binary modules are downloaded from original sources and merged during installation. Ensure you have enough space in /var/lib/flatpak (system-wide) or ~/.local/share/flatpak (user installation).

    # Flatpak base package
    flatpak install net.mkiol.SpeechNote
    
    # Optional NVIDIA add-on package
    flatpak install net.mkiol.SpeechNote.Addon.nvidia
    
    # Optional AMD add-on package
    flatpak install net.mkiol.SpeechNote.Addon.amd
  6. Install the Speech Note .deb package

    main

    After running ./makedeb.sh, a .deb file will be generated in the deb directory. Install it using dpkg and resolve any missing dependencies with apt-get install -f.

    sudo dpkg -i dsnote_*_amd64.deb
    sudo apt-get install -f  # Install any missing dependencies
  7. Install Speech Note on Arch Linux and openSUSE

    main

    Speech Note can be installed on other Linux distributions using the following methods:

    Arch Linux (AUR): Use dsnote or dsnote-git from the AUR.

    openSUSE (Packman repository): Install the base package and the optional Python modules for extended features.

  8. Build Speech Note dependencies on Ubuntu (Qt6)

    main

    To build Speech Note on Ubuntu, you must first install the OpenCL headers, followed by the full set of build dependencies. Note that the project has migrated to Qt6; for Qt5 support, use an earlier release.

    1. Install OpenCL headers: sudo apt install opencl-headers

    2. Install all build dependencies (including CMake, Qt6 modules, and development libraries): (See code block for full list)

    3. Run the build script: ./makedeb.sh

    # First install OpenCL headers (required dependency)
    sudo apt install opencl-headers
    
    # Then install all build dependencies
    sudo apt install \
        appstream autoconf build-essential \
        cmake extra-cmake-modules \
        git libboost-all-dev libpulse-dev libwayland-dev libxinerama-dev \
        libxkbcommon-x11-dev libxtst-dev linguist-qt6 ninja-build \
        ocl-icd-opencl-dev patchelf libtool libtool-bin automake \
        python3-dev qt6-base-dev qt6-declarative-dev qt6-multimedia-dev \
        qt6-tools-dev qml6-module-qtquick qml6-module-qtquick-window \
        qml6-module-qtquick-controls qml6-module-qtquick-dialogs \
        qml6-module-qtquick-layouts qml6-module-qtqml-workerscript \
        qml6-module-qtquick-templates qt6-l10n-tools qt6-base-dev-tools \
        libnoise-dev meson \
        zlib1g-dev
  9. Download language models in Speech Note

    main
    Speech Note does not include model checkpoint files in the installation package. To use specific languages or speech technologies, you must download them using the built-in graphical model browser within the application.
  10. Build Speech Note on Arch Linux

    main

    You can build and install the latest development (git) or stable (release) version using the provided PKGBUILD files.

    git clone <git repository url>
    
    cd dsnote/arch/git      # build latest git version
    # or
    cd dsnote/arch/release  # build latest release version
    
    makepkg -si
    git clone <git repository url>
    
    cd dsnote/arch/git      # build latest git version
    # or
    cd dsnote/arch/release  # build latest release version
    
    makepkg -si
  11. Configure Global Keyboard Shortcuts

    main

    You can trigger listening or reading actions even when Speech Note is minimized or in the background using global keyboard shortcuts.

    Setup:

    1. Go to Settings -> Accessibility -> Use Global Keyboard Shortcuts.
    2. Customize the key bindings using your desktop environment's tool.

    Wayland Support: To use global shortcuts on Wayland, your desktop environment must support the GlobalShortcuts interface in the XDG Desktop Portal service (currently supported in latest KDE Plasma and GNOME).

  12. Build Speech Note on RHEL/Fedora/Rocky Linux

    main

    Build and install the latest development version using the provided SPEC file and make_rpm.sh script.

    First, install the required build dependencies:

    dnf install rpmdevtools autoconf automake boost-devel cmake git kf5-kdbusaddons-devel libarchive-devel libxdo-devel libXinerama-devel libxkbcommon-x11-devel libXtst-devel libtool meson openblas-devel patchelf pybind11-devel python3-devel python3-pybind11 qt5-linguist qt5-qtmultimedia-devel qt5-qtquickcontrols2-devel qt5-qtx11extras-devel rubberband-devel taglib-devel vulkan-headers

    Then build the package:

    git clone <git repository url>
    
    cd dsnote/fedora
    ./make_rpm.sh
    git clone <git repository url>
    
    cd dsnote/fedora
    
    # optionally install build dependencies
    dnf install rpmdevtools autoconf automake boost-devel cmake git kf5-kdbusaddons-devel libarchive-devel libxdo-devel libXinerama-devel libxkbcommon-x11-devel libXtst-devel libtool meson openblas-devel patchelf pybind11-devel python3-devel python3-pybind11 qt5-linguist qt5-qtmultimedia-devel qt5-qtquickcontrols2-devel qt5-qtx11extras-devel rubberband-devel taglib-devel vulkan-headers
    
    ./make_rpm.sh