# eSpeak Phonemizer
Uses [ctypes](https://docs.python.org/3/library/ctypes.html) and [libespeak-ng](https://github.com/espeak-ng/espeak-ng/blob/master/docs/integration.md) to transform text into [IPA](https://en.wikipedia.org/wiki/International_Phonetic_Alphabet) phonemes.
## Installation
First, install libespeak-ng:
```sh
sudo apt-get install libespeak-ng1
```
Next, install espeak_phonemizer:
```sh
pip install espeak_phonemizer
```
If installation was successful, you should be able to run:
```sh
espeak-phonemizer --version
```
## Basic Phonemization
Simply pass your text into the standard input of `espeak-phonemizer`:
```sh
echo 'This is a test.' | espeak-phonemizer -v en-us
ðɪs ɪz ɐ tˈɛst
```
### Separators
Phoneme and word separators can be changed:
```sh
echo 'This is a test.' | espeak-phonemizer -v en-us -p '_' -w '#'
ð_ɪ_s#ɪ_z#ɐ#t_ˈɛ_s_t
```
### Punctuation and Stress
Some punctuation can be kept (.,;:!?) in the output:
```sh
echo 'This: is, a, test.' | espeak-phonemizer -v en-us --keep-punctuation
ðˈɪs: ˈɪz, ˈeɪ, tˈɛst.
```
Stress markers can also be dropped:
```sh
echo 'This is a test.' | espeak-phonemizer -v en-us --no-stress
ðɪs ɪz ɐ tɛst
```
### Delimited Input
The `--csv` flag enables delimited input with fields separated by a '|' (change with `--csv-delimiter`):
```sh
echo 's1|This is a test.' | espeak-phonemizer -v en-us --csv
s1|This is a test.|ðɪs ɪz ɐ tˈɛst
```
Phonemes are added as a final column, allowing you to pass arbitrary metadata through to the output.
### Parallelize with GNU Parallel
```sh
parallel -a /path/to/input.csv --pipepart \
espeak-phonemizer -v en-us --csv \
> /path/to/output.csv
```
Raw data
{
"_id": null,
"home_page": "https://github.com/rhasspy/espeak-phonemizer",
"name": "espeak-phonemizer",
"maintainer": "",
"docs_url": null,
"requires_python": "",
"maintainer_email": "",
"keywords": "",
"author": "Michael Hansen",
"author_email": "mike@rhasspy.org",
"download_url": "https://files.pythonhosted.org/packages/ff/73/2d4ac4076c3a9773528d7e16129367ef9885e9dc36dcf64b516ea013a2f0/espeak_phonemizer-1.3.1.tar.gz",
"platform": null,
"description": "# eSpeak Phonemizer\n\nUses [ctypes](https://docs.python.org/3/library/ctypes.html) and [libespeak-ng](https://github.com/espeak-ng/espeak-ng/blob/master/docs/integration.md) to transform text into [IPA](https://en.wikipedia.org/wiki/International_Phonetic_Alphabet) phonemes.\n\n## Installation\n\nFirst, install libespeak-ng:\n\n```sh\nsudo apt-get install libespeak-ng1\n```\n\nNext, install espeak_phonemizer:\n\n```sh\npip install espeak_phonemizer\n```\n\nIf installation was successful, you should be able to run:\n\n```sh\nespeak-phonemizer --version\n```\n\n## Basic Phonemization\n\nSimply pass your text into the standard input of `espeak-phonemizer`:\n\n```sh\necho 'This is a test.' | espeak-phonemizer -v en-us\n\u00f0\u026as \u026az \u0250 t\u02c8\u025bst\n```\n\n### Separators\n\nPhoneme and word separators can be changed:\n\n```sh\necho 'This is a test.' | espeak-phonemizer -v en-us -p '_' -w '#'\n\u00f0_\u026a_s#\u026a_z#\u0250#t_\u02c8\u025b_s_t\n```\n\n### Punctuation and Stress\n\nSome punctuation can be kept (.,;:!?) in the output:\n\n```sh\necho 'This: is, a, test.' | espeak-phonemizer -v en-us --keep-punctuation\n\u00f0\u02c8\u026as: \u02c8\u026az, \u02c8e\u026a, t\u02c8\u025bst.\n```\n\nStress markers can also be dropped:\n\n```sh\necho 'This is a test.' | espeak-phonemizer -v en-us --no-stress\n\u00f0\u026as \u026az \u0250 t\u025bst\n```\n\n### Delimited Input\n\nThe `--csv` flag enables delimited input with fields separated by a '|' (change with `--csv-delimiter`):\n\n```sh\necho 's1|This is a test.' | espeak-phonemizer -v en-us --csv\ns1|This is a test.|\u00f0\u026as \u026az \u0250 t\u02c8\u025bst\n```\n\nPhonemes are added as a final column, allowing you to pass arbitrary metadata through to the output.\n\n### Parallelize with GNU Parallel\n\n```sh\nparallel -a /path/to/input.csv --pipepart \\\n espeak-phonemizer -v en-us --csv \\\n > /path/to/output.csv\n```\n",
"bugtrack_url": null,
"license": "",
"summary": "Lightweight International Phonetic Alphabet (IPA) phonemizer that uses libespeak-ng",
"version": "1.3.1",
"project_urls": {
"Homepage": "https://github.com/rhasspy/espeak-phonemizer"
},
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "ff732d4ac4076c3a9773528d7e16129367ef9885e9dc36dcf64b516ea013a2f0",
"md5": "3de60ce4030436e682161d4cffc5ee6e",
"sha256": "a591335318e253fc01599370cebc63bcc7f46155a7a7af4496fbf6ca749d0ec9"
},
"downloads": -1,
"filename": "espeak_phonemizer-1.3.1.tar.gz",
"has_sig": false,
"md5_digest": "3de60ce4030436e682161d4cffc5ee6e",
"packagetype": "sdist",
"python_version": "source",
"requires_python": null,
"size": 10249761,
"upload_time": "2023-06-21T20:57:36",
"upload_time_iso_8601": "2023-06-21T20:57:36.486295Z",
"url": "https://files.pythonhosted.org/packages/ff/73/2d4ac4076c3a9773528d7e16129367ef9885e9dc36dcf64b516ea013a2f0/espeak_phonemizer-1.3.1.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2023-06-21 20:57:36",
"github": true,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"github_user": "rhasspy",
"github_project": "espeak-phonemizer",
"travis_ci": false,
"coveralls": false,
"github_actions": false,
"lcname": "espeak-phonemizer"
}