Giter Club home page Giter Club logo

piper-phonemize's Introduction

Piper Phonemization Library

Converts text to phonemes for Piper.

When using eSpeak phonemes, requires an espeak-ng fork with espeak_TextToPhonemesWithTerminator function. This function allows for Piper to preserve punctuation and detect sentence boundaries.

Usage

Pre-compiled releases are available for download.

The piper_phonemize program can be used from the command line:

lib/piper_phonemize -l en-us --espeak-data lib/espeak-ng-data/ <<EOF
This is a test.
This is another test!
EOF
{"phoneme_ids":[1,0,41,0,74,0,31,0,3,0,74,0,38,0,3,0,50,0,3,0,32,0,120,0,61,0,31,0,32,0,10,0,2],"phonemes":["ð","ɪ","s"," ","ɪ","z"," ","ɐ"," ","t","ˈ","ɛ","s","t","."],"processed_text":"This is a test.","text":"This is a test."}
{"phoneme_ids":[1,0,41,0,74,0,31,0,3,0,74,0,38,0,3,0,50,0,26,0,120,0,102,0,41,0,60,0,3,0,32,0,120,0,61,0,31,0,32,0,4,0,2],"phonemes":["ð","ɪ","s"," ","ɪ","z"," ","ɐ","n","ˈ","ʌ","ð","ɚ"," ","t","ˈ","ɛ","s","t","!"],"processed_text":"This is another test!","text":"This is another test!"}

Arabic diacritization is supported through libtashkeel (model included):

echo 'مرحبا' | lib/piper_phonemize -l ar --espeak-data lib/espeak-ng-data/ --tashkeel_model etc/libtashkeel_model.ort
{"phoneme_ids":[1,0,25,0,120,0,14,0,30,0,43,0,14,0,15,0,121,0,14,0,26,0,2],"phonemes":["m","ˈ","a","r","ħ","a","b","ˌ","a","n"],"processed_text":"مَرْحَبًا","text":"مرحبا"}

See src/test.cpp for a C++ example using libpiper_phonemize.

Python

The piper_phonemize Python package is built using pybind11.

See src/python_test.py for a Python example.

Building

Use Docker:

docker buildx build . -t piper-phonemize --output 'type=local,dest=dist'

Find library and Python wheels in dist/

piper-phonemize's People

Contributors

synesthesiam avatar leso-kn avatar tuxpoldo avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.