Giter VIP home page Giter VIP logo

pyfestival's Introduction

Py-festival

A Python wrapper around the Festival Speech Synthesis System.

Installation

  1. First install the Python, Festival and their headers
    On Debian:
sudo apt-get install python python-dev festival festival-dev

On other operating systems (e.g. macOS) you may need to manually install festival. E.g. [1] or [2]

  1. Then install using either pip or directly from github:
pip install pyfestival

or

pip install git+https://github.com/techiaith/pyfestival#festival

Environment Variables

If your festival/speechtools headers and libs aren't in the standard place, you may need to set the following variables before installing with pip:

  • FESTIVAL_INCLUDE - festival header directory. Default is /usr/include/festival
  • SPEECH_INCLUDE - speech tools header directory. Default is /usr/include/speech_tools
  • FESTIVAL_LIB - lib directory for festival/speech tools /usr/lib

Threading notes

Festival is not thread-safe. If you attempt to invoke it from a thread other than which is was imported in then you will see the error:

SIOD ERROR: the currently assigned stack limit has been exceeded

It may be imported locally in each new thread once the previous thread has exited.

pyfestival's People

Contributors

alex-eri avatar chrisnorman7 avatar iamsrp avatar pjrobertson avatar yvt avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar

pyfestival's Issues

Changing saved audio filename

Hello,

I'm having an issue with changing the location of the saved audio file. Would there be an easy way to do so?

Cheers

fatal error: 'festival.h' file not found

Hi, I'm trying to install festival on my Mac, but this happens:

macosx-10.9-x86_64-3.9/_festival.o
_festival.cpp:2:10: fatal error: 'festival.h' file not found
#include <festival.h>
^~~~~~~~~~~~
1 error generated.
error: command '/usr/bin/gcc' failed with exit code 1
----------------------------------------

Yes, I have read the readme and added the lines you've said.

Снимок экрана 2021-04-29 в 12 05 48

Please, help to resolve the issue!
You have only provided a command for Debian for installing the headers. Is there a similar one for MacOS?

Linking to static libraries

Hi, thanks for this project. I'm using a modified version of festival for which I only create a static library libFestival.a. I have also only static libraries for speech tools. How could I modify setup.py in order to link with these static librairies?

Import error with Python 3.10

Installed with pip install pyfestival
Wrote very simple script

import festival

festival.sayText("hello world")

Expected

Festival to say "hello world"

Actual

>>> import festival
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/dhill/venvs/tpc/lib/python3.10/site-packages/festival.py", line 3, in <module>
    from . import _festival
ImportError: attempted relative import with no known parent package
>>> 

Catching ImportError at the top of festival.py resolves this issue and speech works.

While try to install using pip giving error on ubuntu 16.04

Collecting pyfestival
  Downloading pyfestival-0.5.tar.gz
Installing collected packages: pyfestival
  Running setup.py install for pyfestival ... error
    Complete output from command /usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-PuW9dS/pyfestival/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-5A_Ysp-record/install-record.txt --single-version-externally-managed --compile:
    running install
    running build
    running build_py
    creating build
    creating build/lib.linux-x86_64-2.7
    copying festival.py -> build/lib.linux-x86_64-2.7
    running build_ext
    building '_festival' extension
    creating build/temp.linux-x86_64-2.7
    x86_64-linux-gnu-gcc -pthread -DNDEBUG -g -fwrapv -O2 -Wall -Wstrict-prototypes -fno-strict-aliasing -Wdate-time -D_FORTIFY_SOURCE=2 -g -fstack-protector-strong -Wformat -Werror=format-security -fPIC -I/usr/include/festival -I/usr/include/speech_tools -I/usr/include/python2.7 -c _festival.cpp -o build/temp.linux-x86_64-2.7/_festival.o
    cc1plus: warning: command line option ‘-Wstrict-prototypes’ is valid for C/ObjC but not for C++
    _festival.cpp:2:22: fatal error: festival.h: No such file or directory
    compilation terminated.
    error: command 'x86_64-linux-gnu-gcc' failed with exit status 1

    ----------------------------------------
Command "/usr/bin/python -u -c "import setuptools, tokenize;__file__='/tmp/pip-build-PuW9dS/pyfestival/setup.py';exec(compile(getattr(tokenize, 'open', open)(__file__).read().replace('\r\n', '\n'), __file__, 'exec'))" install --record /tmp/pip-5A_Ysp-record/install-record.txt --single-version-externally-managed --compile" failed with error code 1 in /tmp/pip-build-PuW9dS/pyfestival/

import festival causes error when script is executed

festival works perfectly as a standalone. When I create a python script with the
following code I get the same error on all commands.

import festival

festival.info()

ImportError: /home/pi/pyfestival/_festival.so: undefined symbol: tgetnum

#OR

festival.textToWav("i like it like that")

ImportError: /home/pi/pyfestival/_festival.so: undefined symbol: tgetnum

This is being executed on a raspberry pi 3 B running Raspbian Stretch.
I have spent days on this but nothing I can find on the web seems to help.
From what I found tgetnum has something to do with the ncurses library, which
is install on the machine. However, it is not required by festival for my architecture.
This may not help speed up processing but I would like to see for myself.

ImportError: /usr/lib/libestbase.so.2.5.0.1: undefined symbol: snd_pcm_hw_params_set_channels when importing festival

$ /sbin/python /home/kris/faster-whisper/festival_test.py
Traceback (most recent call last):
  File "/home/kris/.local/lib/python3.10/site-packages/festival.py", line 3, in <module>
    from . import _festival
ImportError: attempted relative import with no known parent package

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/home/kris/faster-whisper/festival_test.py", line 1, in <module>
    import festival
  File "/home/kris/.local/lib/python3.10/site-packages/festival.py", line 6, in <module>
    import _festival
ImportError: /usr/lib/libestbase.so.2.5.0.1: undefined symbol: snd_pcm_hw_params_set_channels

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.