Skip to main content

License: GPL v3 Python 3.10 Release PyPI pre-commit Ruff tests

Icespeak

Icespeak is a Python 3.10+ library that makes Icelandic-language speech synthesis easy.

Installation

python3 -m pip install icespeak

To also install the speak command line tool:

python3 -m pip install 'icespeak[cli]'

Local installation

Note: The Azure TTS package currently only supports OpenSSL version 3.0.*

Clone the repository and cd into the folder. Then create and activate a virtual environment:

python3 -m venv venv
source venv/bin/activate

Install minimal set of dependencies to use the library:

python3 -m pip install .

In order to use the CLI interface, speak, install with:

python3 -m pip install '.[cli]'

Alternatively, to install in editable mode with the development dependencies:

python3 -m pip install -e '.[cli]' --group dev

This project uses uv for dependency management, so the above is equivalent to simply running:

uv sync --all-extras

Usage

Before using, set the environment variable for each service you want to use. Most of them take a JSON string, but the OpenAI key is passed as-is:

export ICESPEAK_AWSPOLLY_API_KEY='{"aws_access_key_id":"your-id","aws_secret_access_key":"your-secret","region_name":"us-east-1"}'
export ICESPEAK_AZURE_API_KEY='{"key":"your-azure-key","region":"your-region"}'
export ICESPEAK_OPENAI_API_KEY='your-openai-key'

These can also be placed in a .env file in the working directory.

Output audio files are saved to the directory specified by the ICESPEAK_AUDIO_DIR environment variable. By default Icespeak creates the directory <TEMP DIR>/icespeak where <TEMP DIR> is the temporary directory on your platform, fetched via tempfile.gettempdir().

By default, generated audio files are removed upon a clean exit, but this can be disabled by setting ICESPEAK_AUDIO_CACHE_CLEAN=0.

Text-to-speech

Simple example of TTS, which includes phonetic transcription:

from icespeak import tts_to_file, TTSOptions

text = """\
Þetta er texti fyrir talgervingu. \
Í honum er ýmislegt sem mætti vera hljóðritað, \
t.d. ræður talgerving oft illa við íslenskar skammstafanir, \
tölvupósta eins og ekki.tolvupostur@vefsida.is,
eða prósentur eins og 48,3%, o.fl.\
"""
tts_out = tts_to_file(
    text,
    TTSOptions(
        text_format="text",  # Set to 'ssml' if SSML tags in text should be interpreted
        audio_format="mp3",  # Output audio will be in mp3 format
        voice="Gudrun",  # Azure TTS voice
    ),
    transcribe=True,  # Default is True
)
print(tts_out.file)  # pathlib.Path instance pointing to file on local file system
print(tts_out.text)  # text that was sent to the TTS service (after the phonetic transcription)

Command line tool

Installing with the cli extra provides the speak command:

# Synthesize and play the given text
speak "Góðan daginn og til hamingju með lífið."

# Read the text from a file, pick a voice, and save the audio instead of playing it
speak --file input.txt --voice Gudrun --no-play --out output.mp3 --audio-format mp3

# List the voices available with the API keys you have configured
speak --list-voices

Run speak --help for the full list of options.

License

Icespeak is Copyright © 2025 Miðeind ehf.

Miðeind ehf.

This set of programs is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

This set of programs is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

The full text of the GNU General Public License v3 is included here and also available here: https://www.gnu.org/licenses/gpl-3.0.html.

If you wish to use this set of programs in ways that are not covered under the GNU GPLv3 license, please contact us at mideind@mideind.is to negotiate a custom license. This applies for instance if you want to include or use this software, in part or in full, in other software that is not licensed under GNU GPLv3 or other compatible licenses.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

icespeak-0.4.0.tar.gz (65.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

icespeak-0.4.0-py3-none-any.whl (60.6 kB view details)

Uploaded Python 3

File details

Details for the file icespeak-0.4.0.tar.gz.

File metadata

  • Download URL: icespeak-0.4.0.tar.gz
  • Upload date:
  • Size: 65.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for icespeak-0.4.0.tar.gz
Algorithm Hash digest
SHA256 2956fbd529259d076a205ea21c8ab6e5debacdbfb1fddc2c0d73fe89a559f798
MD5 3660f87e382242ed4cdf843eca9489d1
BLAKE2b-256 29eda0eb4dac619a15dc0e1eb3d4704b5f78bab6abbaf1c9134353504068146d

See more details on using hashes here.

File details

Details for the file icespeak-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: icespeak-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 60.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for icespeak-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 6a395c2fe1f50e181e0961f1f28e864524168a6e513cccd54654e03efebf0c44
MD5 ba4a64d7d636e8966d51e8516788ab63
BLAKE2b-256 b0aa5006ab0e46d2cae997a31cc2f5dc646bbf0a090e96085f4fd06ce2d9aed7

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 files

0.3.7

2 files

0.3.5

2 files

0.3.3

2 files

0.3.2

2 files

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page