Skip to main content

Transcriber Wrapper

Code style: black Coverage Lines of Code

Inspired by Phonemizer, this a simpler version focused in transcription applications that work with IPA (International Phonetic Alphabet). This works like a wrapper which is responsible to call a back-end application, let's say espeak-ng. It adds some features on top of it like with stress option.

Supported back-ends

Usage

You need to install espeak-ng and festival on your operational system. See Dockerfile.dev as an example. After that, you can create a transcriber and then use it in your logic:

from typing import List

import transcriber_wrapper

# The standard language is "en-us"
# The standard back-end is "espeak"
transcriber_en_us = transcriber_wrapper.build_transcriber()

def do_the_thing(words: List[str]) -> List[str]:
    return transcriber_en_us.transcribe(words)

Don't forget to see test_builder.py to get insights how to use this project!

Development

Executing commands directly on the binaries

After building the remote interpreter service, just enter in it:

docker-compose run remote-interpreter sh

You must be at /usr/bin/. Then try one of these below.

eSpeakNG

Check out these links:

Some sample commands:

espeak-ng "Hello my friend, stay awhile and listen!" -ven-us -x --ipa -q --sep=_
espeak-ng "Curiosity" -ven-us -x --ipa -q --sep=" "
espeak-ng "If you will not bow before a sultan, then you will cower before a sorcerer!" -ven-us -x --ipa -q
espeak-ng --voices

Festival

You can execute festival --help to get a list of what you can do through what the festival developers call "Shell API" (see more details here).

You can use the script festival.lisp to get the computation from a given word, some samples:

WORD=something festival -b /app/scripts/festival.lisp
WORD=theoretically festival -b /app/scripts/festival.lisp

What you can do is just type festival and then start its command line prompt. From there you can do the following for example:

# It will list voices available
festival> (voice.list)
# Default voice
festival> voice_default
# This won't work with our Docker image, but if you are on your ubuntu/debian machine, it may will
(SayText "Can someone refactor festival to be writen in Python with a friendly API?") 

Updating pipenv dependencies

If you update Pipfile, you can issue the following command to refresh your lock file:

docker-compose run remote-interpreter pipenv update

If you'd like to add a new package, let's say a production one:

docker-compose run remote-interpreter pipenv install pyparsing

Don't forget to update your service!

docker-compose build remote-interpreter

Metadata

Release files for transcriber-wrapper 1.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for transcriber-wrapper 1.2.1
File Size Uploaded Provenance Actions
transcriber-wrapper-1.2.1.tar.gz 22.8 kB Without provenance Details for transcriber-wrapper-1.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for transcriber-wrapper 1.2.1
File Interpreter ABI Platform Actions
transcriber_wrapper-1.2.1-py3-none-any.whl Python 3 none any Details for transcriber_wrapper-1.2.1-py3-none-any.whl

Total release size: 51.8 kB

Release files / transcriber-wrapper-1.2.1.tar.gz

Download URL transcriber-wrapper-1.2.1.tar.gz
Size 22.8 kB
Tags Source
SHA-256 checksum
How to use checksums
4970dcde90c8d24f7e074098463205a233fab4f56004ee28096f18be36246f31
BLAKE2b-256 checksum
How to use checksums
662f30f8a201bd6183446a61d216f80404cf1c10adf9a32d6a6b5dd23072c7c8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Release files / transcriber_wrapper-1.2.1-py3-none-any.whl

Download URL transcriber_wrapper-1.2.1-py3-none-any.whl
Size 29.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
66e3ef611c3d24602adb6a22bc8a36d538c944f4df1ec7f5c36a602a6ff93902
BLAKE2b-256 checksum
How to use checksums
2d01de5c762fd0ae408ef9d91c539e0f0ab0dec5d04085c666a1de12f0ae7833
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.9.4

Security for transcriber-wrapper 1.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page