{"id":6408,"library":"phonemizer","title":"Phonemizer","description":"Phonemizer is a simple Python library for converting text into phonemes for multiple languages. It acts as a wrapper around various external phonemization backends like eSpeak, Festival, and Flite. The library is actively maintained with regular releases, typically addressing bug fixes, performance improvements, and adding new features.","status":"active","version":"3.3.0","language":"en","source_language":"en","source_url":"https://github.com/bootphon/phonemizer","tags":["NLP","phonetics","speech-to-text","text-to-speech","linguistics"],"install":[{"cmd":"pip install phonemizer","lang":"bash","label":"Install with pip"}],"dependencies":[{"reason":"Default backend for phonemization; requires system-level installation (e.g., `sudo apt-get install espeak` on Debian/Ubuntu, `brew install espeak` on macOS).","package":"eSpeak","optional":false},{"reason":"Alternative phonemization backend; requires system-level installation. Was the default prior to v3.0.","package":"Festival","optional":true},{"reason":"Alternative phonemization backend; requires system-level installation.","package":"Flite","optional":true}],"imports":[{"note":"The direct import `from phonemizer import phonemize` was introduced in v2.2.1 and is the preferred and more concise way to access the main function. The old path still works for compatibility but is less idiomatic.","wrong":"from phonemizer.phonemize import phonemize","symbol":"phonemize","correct":"from phonemizer import phonemize"}],"quickstart":{"code":"from phonemizer import phonemize\n\n# NOTE: This library requires an external phonemization backend (e.g., eSpeak)\n# to be installed on your system. For Debian/Ubuntu:\n# sudo apt-get install espeak\n# For macOS:\n# brew install espeak\n\ntexts = [\n    \"Hello, world!\",\n    \"This is a test.\"\n]\n\n# Using the default 'espeak' backend (since v3.0)\n# You can specify language (e.g., 'en-us') and backend ('espeak') explicitly.\nphonemes = phonemize(texts, language='en-us', backend='espeak')\n\nprint(\"Original texts:\", texts)\nprint(\"Phonemes:\", phonemes)\n\n# Example with a different separator\nphonemes_with_separator = phonemize(\n    texts,\n    language='en-us',\n    backend='espeak',\n    separator='_'\n)\nprint(\"Phonemes with custom separator:\", phonemes_with_separator)","lang":"python","description":"Demonstrates how to import the `phonemize` function and convert a list of text strings into their phonemic representations using the default `espeak` backend. It also highlights the essential prerequisite of installing an external phonemization engine."},"warnings":[{"fix":"Upgrade your Python environment to 3.8 or newer, or pin `phonemizer<3.3.0` if you must use an older Python version.","message":"Phonemizer v3.3.0 and later require Python >= 3.8. Previous versions supported Python >= 3.6. Attempting to install or run on older Python versions will result in dependency resolution or runtime errors.","severity":"breaking","affected_versions":">=3.3.0"},{"fix":"Install your desired phonemization backend. For eSpeak on Debian/Ubuntu: `sudo apt-get install espeak`. On macOS: `brew install espeak`.","message":"Phonemizer relies on external phonemization engines (e.g., eSpeak, Festival, Flite) installed at the system level. It will not function without at least one backend available. eSpeak is the recommended and default backend.","severity":"gotcha","affected_versions":"All versions"},{"fix":"Explicitly set the `backend` argument in your `phonemize` calls (e.g., `backend='festival'`) if you require the old behavior, or ensure `espeak` is installed and compatible with your desired output.","message":"In v3.0, the default phonemization backend changed from `festival` to `espeak`. If your application implicitly relied on `festival` and does not explicitly specify a backend, its output may change significantly or break if `espeak` is not available.","severity":"breaking","affected_versions":">=3.0"},{"fix":"Review your code to account for preserved empty lines. If you wish to remove them, you might need to filter the output manually or use the `--preserve-empty-lines=False` option (if applicable, check latest docs for exact option name and availability).","message":"Prior to v3.0, empty lines in input texts were automatically removed from the output. Since v3.0, empty lines are preserved by default, potentially leading to different list lengths or unexpected empty strings in the phonemized output.","severity":"breaking","affected_versions":">=3.0"}],"env_vars":null,"last_verified":"2026-04-15T00:00:00.000Z","next_check":"2026-07-14T00:00:00.000Z"}