• Stars
    star
    782
  • Rank 56,804 (Top 2 %)
  • Language
    C
  • License
    Other
  • Created over 8 years ago
  • Updated over 1 year ago

Reviews

There are no reviews yet. Be the first to send feedback to the community and the maintainers!

Repository Details

Mycroft's TTS engine, based on CMU's Flite (Festival Lite)

Mimic - The Mycroft TTS Engine

Build Status codecov.io Coverity Scan

Mimic is a fast, lightweight Text-to-speech engine developed by Mycroft A.I. and VocaliD, based on Carnegie Mellon Universityโ€™s Flite (Festival-Lite) software. Mimic takes in text and reads it out loud to create a high quality voice.

Official project site: mimic.mycroft.ai

Supported platforms

  • Linux (ARM & Intel architectures)
  • Mac OS X
  • Windows

Untested

  • Android

Future

  • iOS

Requirements

This is the list of requirements. Below there is the commands needed on the most popular distributions and supported OS.

  • A good C compiler:
    • Linux or Mac OSX: Recommended: gcc or clang
    • Windows: Recommended: GCC under Cygwin or mingw32
  • GNU make, automake and libtool
  • pkg-config
  • Optionally, PCRE2 library and headers (they are compiled otherwise)
  • An audio engine:
    • Linux: ALSA/PortAudio/PulseAudio (Recommended: ALSA)
    • Mac OSX: PortAudio
    • Windows: PortAudio

Linux

On Debian/Ubuntu
$ sudo apt-get install gcc make pkg-config automake libtool libasound2-dev
On Fedora
$ sudo dnf install gcc make pkgconfig automake libtool alsa-lib-devel
On Arch
$ sudo pacman -S --needed install gcc make pkg-config automake libtool alsa-lib

Mac OSX

  • Install Brew

    $ /usr/bin/ruby -e "$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)"
    
  • Install pkg-config, automake, libtool, pcre2 and PortAudio

    $ brew install pkg-config automake libtool portaudio pcre2
    

Windows

Cross compiling:

The fastest and most straightforward way to build mimic for windows is by cross-compilation from linux. This requires some additional packages to be installed.

On Ubuntu 18.04 (bionic):

sudo apt-get install gcc make pkg-config automake libtool libpcre2-dev wine-stable binutils-mingw-w64-i686 mingw-w64-i686-dev gcc-mingw-w64-i686

On Ubuntu 16.04 (xenial):

sudo apt-get install gcc make pkg-config automake libtool libpcre2-dev wine binutils-mingw-w64-i686 mingw-w64-i686-dev gcc-mingw-w64-i686

On Ubuntu 14.04 (trusty):

sudo apt-get install gcc make pkg-config automake libtool mingw32 mingw32-runtime wine

Native Windows building

  • Audio device and audio libraries are optional, as mimic can write its output to a waveform file.
  • Some of the source files are quite large, that some C compilers might choke on these. So, gcc is recommended.
  • Visual C++ 6.0 is known to fail on the large diphone database files
  • The build process is MUCH slower on Windows.

Build

On a native build (not cross-compilation)

  • Clone the repository

    $ git clone https://github.com/MycroftAI/mimic1.git
    
  • Navigate to mimic directory

    $ cd mimic1
    
  • Build and install missing dependencies (pcre2)

    $ ./dependencies.sh --prefix="/usr/local"
    
  • Generate mimic build scripts

    $ ./autogen.sh
    
  • Configure.

    $ ./configure --prefix="/usr/local"
    
  • Build

    $ make
    
  • Check

    $ make check
    

Cross compilation:

  • Run the windows build script:
./run_testsuite.sh winbuild
  • Test it: The directory install will contain bin/mimic.exe file
wine ./mimic.exe -t "hello world" 
  • Distribute it

You can distribute the compiled mimic by adding to a zip file everything in the install/winbuild/bin directory.

Usage

By default mimic will play the text using an audio device. Alternatively it can output the wave file in RIFF format (often called .wav).

Read text

  • To an audio device

    $ ./mimic -t TEXT
    

    Example

    $ ./mimic -t "Hello. Doctor. Name. Continue. Yesterday. Tomorrow."
    
  • To an audio file

    $ ./mimic -t TEXT -o WAVEFILE
    

    Example

    $ ./mimic -t "Hello. Doctor. Name. Continue. Yesterday. Tomorrow." -o hello.wav
    

Read text from file

  • To an audio device

    $ ./mimic -f TEXTFILE
    

    Example

    $ ./mimic -f doc/alice
    
  • To an audio file

    $ ./mimic -f TEXTFILE -o WAVEFILE`
    

    Example

    $ ./mimic -f doc/alice -o hello.wav
    

Change voice

  • List available internal voices

    $ ./mimic -lv
    
  • Use an internal voice

    $ ./mimic -t TEXT -voice VOICE
    

    Example

    $ ./mimic -t "Hello" -voice slt
    
  • Use an external voice file

    $ ./mimic -t TEXT -voice VOICEFILE
    

    Example

    $ ./mimic -t "Hello" -voice voices/cmu_us_slt.flitevox
    
  • Use an external voice url

    $ ./mimic -t TEXT -voice VOICEURL
    

    Example

    $ ./mimic -t "Hello" -voice http://www.festvox.org/flite/packed/flite-2.0/voices/cmu_us_ksp.flitevox
    
Notes
  • mimic offers several voices that can use different speech modelling techniques (diphone, clustergen, hts). Voices can differ a lot on size, naturalness and intelligibility.

    • Diphone voices are less computationally expensive and quite intelligible but they lack naturalness (sound more robotic). e.g. ./mimic -t "Hello world" -voice kal16

    • clustergen voices can sound more natural and intelligible at the expense of size and computational requirements. e.g.: e.g. ./mimic -t "Hello world" -voice slt, ./mimic -t "Hello world" -voice ap

    • hts voices usually may sound a bit more synthetic than clustergen voices, but have much smaller size. e.g.: e.g. ./mimic -t "Hello world" -voice slt_hts

  • Voices can be compiled (built-in) into mimic or loaded from a .flitevox file. The only exception are hts voices. hts voices combine both a compiled function with a voice data file .htsvoice. Mimic will look for the .htsvoice file when the hts voice is loaded, looking into the current working directory, the "voices" subdirectory and the $prefix/share/mimic/voices directory if it exists.

  • Voice names are identified as loadable files if the name includes a "/" (slash) otherwise they are treated as internal compiled-in voices.

  • The voices/ directory contains several flitevox voices. Existing Flite voices can be found here: http://www.festvox.org/flite/packed/flite-2.0/voices/

  • The voice referenced via an url will be downloaded on the fly.

Other options

Voices accept additional debug options. specified as --setf feature=value in the command line. Wrong values can prevent mimic from working. Some speech modelling techniques may not implement support for changing these features so at some point some voices may not provide support for these options. Here are some examples:

  • Use simple concatenation of diphones without prosodic modification

    ./mimic --sets join_type=simple_join doc/intro.txt
    
  • Print sentences as they are said

    ./mimic -pw doc/alice
    
  • Make it speak slower

    ./mimic --setf duration_stretch=1.5 doc/alice
    
  • Make it speak faster

    ./mimic --setf duration_stretch=0.8 doc/alice
    
  • Make it speak higher

    ./mimic --setf int_f0_target_mean=145 doc/alice
    

See lang/cmu_us_kal/cmu_us_kal.c) to see some other features and values.

Say the hour

  • The talking clock requires a single argument HH:MM. Under Unix you can call it
    ./mimic_time `date +%H:%M` 
    

Benchmarking

  • For benchmarking, "none" can be used to discard the generated audio and give a summary of the speed:
    ./mimic -f doc/alice none
    

How to Contribute

For those who wish to help contribute to the development of mimic there are a few things to keep in mind.

Git branching structure

We will be using a branching struture similar to the one described in this article

In short
  • master branch is for stable releases,

  • development branch is where development work is done between releases,

  • Any feature branch should branch off from development, and when complete will be merged back into development.

  • Once enough features are added or a new release is complete those changes in development will be merged into master, then work can continue on development for the next release.

Coding Style Requirements

To keep the code in mimic coherent a simple coding style/guide is used. It should be noted that the current codebase as a whole does not meet some of these guidlines,this is a result of coming from the flite codebase. As different parts of the codebase are touched, it is the hope that these inconsistancies will diminish as time goes on.

  • Indentation

    Each level of indentation is 4 spaces.

  • Braces

    Braces always comes on the line following the statement.

    Example

    void cool_function(void)
    {
        int cool;
        for (cool = 0; cool < COOL_LIMIT; cool++)
        {
            [...]
            if (cool == AWESOME)
            {
                [...]
            }
        }
    }
  • If-statements

    Always use curly braces.

    Example

    if(condition)
    {                             /*always use curly braces even if the 'if' only has one statement*/
        DoJustThisOneThing();        
    }
    
    if(argv[i][2] == 'h' &&      /*split 'if' conditions to multiple lines if the conditions are long */
       argv[i][3] == 'e' &&      /*or if it makes things more readable. */
       argv[i][4] == 'l' && 
       argv[i][5] == 'p')
    {
          /*example taken from args parsing code*/
          /* code */
    }
    else if(condition)
    {
          /* code */
    }
    else
    {
        /* code */
    }
  • Switch-statements

    Always keep the break statement last in the case, after any code blocks.

    Example

    switch(state)
    {
        case 1:
        {               /* even if the case only has one line, use curly braces (similar reasoning as with if's) */ 
            doA(1);
        } break;
                            /* separate cases with a line */
        case 2:             /* unless it falls into the next one */
        case 3:
        {
            DoThisFirst();
        }                   /* no break, this one also falls through */
        case 4:
        {                   /* notice that curly braces line up with 'case' on line above */
            int b = 2;
            doA(b);
        } break;        /* putting 'break' on this line saves some room and makes it look a little nicer */
    
        case 5:
        {
            /* more code */
        } break;
    
        default:        /* It is nice to always have a default case, even if it does nothing */
        {
            InvalidDefaultCase(); /* or whatever, it depends on what you are trying to do. */
        }
    }
  • Line length

    There's no hard limit but if possible keep lines shorter than 80 characters.

Vimrc

For those of you who use vim, add this to your vimrc to ensure proper indenting.

"####Indentation settings
:filetype plugin indent on
" show existing tab with 4 spaces width
:set tabstop=4
" when indenting with '>', use 4 spaces width
:set shiftwidth=4
" On pressing tab, insert 4 spaces
:set expandtab
" fix indentation problem with types above function name
:set cinoptions+=t0
" fix indentation of { after case
:set cinoptions+==0
" fix indentation of multiline if
:set cinoptions+=(0   "closing ) to let vimrc hylighting work after this line

"see http://vimdoc.sourceforge.net/htmldoc/indent.html#cinoptions-values
"for more indent options
Indent command (currently does not indent switch/cases properly)
indent [FILE] -npcs -i4 -bl -Tcst_wave -Tcst_wave_header -Tcst_rateconv \
      -Tcst_voice -Tcst_item -Tcst_features -Tcst_val -Tcst_va -Tcst_viterbi \
      -Tcst_utterance -Tcst_vit_cand_f_t -Tcst_vit_path_f_t -Tcst_vit_path \
      -Tcst_vit_point -Tcst_string -Tcst_lexicon -Tcst_relation \
      -Tcst_voice_struct -Tcst_track -Tcst_viterbi_struct -Tcst_vit_cand \
      -Tcst_tokenstream -Tcst_tokenstream_struct -Tcst_synth_module \
      -Tcst_sts_list -Tcst_lpcres -Tcst_ss -Tcst_regex -Tcst_regstate \
      -Twchar_t -Tcst_phoneset -Tcst_lts_rewrites -Tlexicon_struct \
      -Tcst_filemap -Tcst_lts_rules -Tcst_clunit_db -Tcst_cg_db \
      -Tcst_audio_streaming_info -Tcst_audio_streaming_info_struct -Tcst_cart \
      -Tcst_audiodev -TVocoderSetup -npsl -brs -bli0 -nut

Acknowledgements

see ACKNOWLEDGEMENTS

License

See COPYING

More Repositories

1

mycroft-core

Mycroft Core, the Mycroft Artificial Intelligence platform.
Python
6,472
star
2

mimic3

A fast local neural text to speech engine for Mycroft
Python
1,000
star
3

mycroft-precise

A lightweight, simple-to-use, RNN wake word listener
Python
814
star
4

enclosure-picroft

Mycroft interface for Raspberry Pi environment
Shell
802
star
5

mycroft-skills

A repository for sharing and collaboration for third-party Mycroft skills development.
HTML
757
star
6

adapt

Adapt Intent Parser
Python
707
star
7

mimic-recording-studio

Mimic Recording Studio is a Docker-based application you can install to record voice samples, which can then be trained into a TTS voice with Mimic2
JavaScript
491
star
8

Mycroft-Android

Android companion app, sends commands from your Android device to your Mycroft system and returns the output as speech or other medium to the Android device.
Kotlin
343
star
9

mycroft-gui

The Graphical User Interface used by the Mycroft Mark II and more
C++
165
star
10

padatious

A neural network intent parser
Python
158
star
11

selene-backend

Microservices and web apps to support Mycroft devices
Python
143
star
12

ZZZ-RETIRED__openstt

RETIRED - OpenSTT is now retired. If you would like more information on Mycroft AI's open source STT projects, please visit:
143
star
13

mimic3-voices

Voice models for Mimic 3 text to speech system
HTML
115
star
14

personal-backend

WORK IN PROGRESS: A Flask personal backend alternative for running your own version of https://home.mycroft.ai
Python
114
star
15

hardware-mycroft-mark-II

Mycroft's Mark II Rpi mechanical, electrical and industrial designs
Python
106
star
16

docker-mycroft

Mycroft Development Environment inside Docker!
Dockerfile
98
star
17

hardware-mycroft-mark-1

Open-sourcing our mechanical, electrical and industrial designs
92
star
18

MycroftCore-Android

MycroftCore on Android as a native app
Java
86
star
19

documentation

Mycroft.AI documentation for all public facing technical components.
Python
81
star
20

sonopy

A simple audio feature extraction library
Python
78
star
21

lingua-franca

Mycroft's multilingual text parsing and formatting library
Python
73
star
22

selene-ui

Web applications to support the Mycroft AI project.
TypeScript
48
star
23

Precise-Community-Data

Pre-trained Precise models and training data provided by the Mycroft Community
47
star
24

ZZZ-RETIRED__mycroft-core-documentation

ZZZ ARCHIVED - Documentation for Mycroft Core.
34
star
25

mycroft-skills-kit

Mycroft Skills Kit
Python
29
star
26

installers

Installers and instructions for getting Mycroft working on different equipment, OS platforms and desktops.
Shell
28
star
27

contributors

Contributors building the Mycroft open source project
23
star
28

ZZZ-RETIRED__rpi3-headless-wifi-setup

Retired project, replaced by:
Python
21
star
29

mycroft-dinkum

A consumer ready version of Mycroft specifically for the Mark II.
Python
19
star
30

skill-weather

Mycroft AI official Weather Skill, providing weather conditions and forecasts.
Python
19
star
31

skill-wiki

Query Wikipedia articles
Python
18
star
32

skill-hello-world

Mycroft AI Hello World Skill - use this basic Skill to see how Mycroft AI Skills work.
Python
16
star
33

mimic1-core

Core of the mimic TTS system
C
14
star
34

mycroft-skills-manager

Mycroft Skills Manager
Python
14
star
35

skill-alarm

Mycroft AI official Alarm Skill - Set single and recurring alarms, with a choice of alarm sounds
Python
14
star
36

skill-reminder

Mycroft AI official Reminder Skill - set reminders
Python
14
star
37

skill-singing

Mycroft AI official Singing Skill - Mycroft speaks lyrics to popular songs
Python
14
star
38

mycroft-messagebus-client

Python module for connecting to the mycroft messagebus
Python
13
star
39

skill-installer

Mycroft AI official Skill installation Skill - allowing voice installation of Skills
Python
12
star
40

mycroft-precise-python-experiments

Python Experiments for Mycroft Precise Wake Word Listener
Python
12
star
41

snapcraft-mycroft-core

This project is for building mycroft-core snaps
Jsonnet
12
star
42

pylisten

A simple pyaudio microphone interface
Python
11
star
43

padaos

A rigid, lightweight, dead-simple intent parser
Python
11
star
44

ZZZ-RETIRED__adapt-documentation

Retired repo, formerly was the source of docs shown on https://adapt.mycroft.ai
11
star
45

skill-desktop-launcher

Mycroft AI official Desktop Launcher Skill - launch applications in Linux
Python
11
star
46

skill-volume

Mycroft AI official Volume Skill - control the volume of your Device
Python
10
star
47

precise-data

Binary data used for Mycroft Precise
9
star
48

fallback-duckduckgo

Mycroft AI official Duck Duck Go Skill - used as a fallback if an Utterance can't be matched to an Intent
Python
9
star
49

skill-npr-news

Mycroft AI official News Skill, providing the latest news report from your favorite broadcast.
Python
9
star
50

enclosure-mark1

Replacing the faceplate repo
C++
9
star
51

mycroft-skills-data

Metrics and data relating to Skills built for the Mycroft Core system
8
star
52

ML-Tools

Tools for ML Research
Jupyter Notebook
8
star
53

plugin-tts-mimic3

Text to speech plugin for Mycroft using Mimic 3
Python
8
star
54

skill-stop

Mycroft AI official Stop Skill - stop the actions of a Skill that are in progress
Python
8
star
55

fallback-wolfram-alpha

Mycroft AI official Wolfram Alpha Skill - used as a fallback if an Intent is not matched
Python
8
star
56

skill-audio-record

Mycroft AI official Audio Record Skill - record audio and play it back
Python
8
star
57

ZZZ-RETIRED__mycroft-slackbot

Retired, Mycroft Slack is no longer active
Java
8
star
58

skill-stock

Mycroft AI official Stock Skill - providing current prices of stocks
Python
7
star
59

skill-joke

Mycroft AI official Joke Skill - provide basic jokes
Python
7
star
60

skill-camera

Camera Skill for Mycroft AI
QML
7
star
61

mycroft-timer

Mycroft AI official Timer Skill - set multiple named timers
Python
7
star
62

skill-homescreen

Python
7
star
63

skill-mark-2

Control of the Mycroft Mark 2 enclosure
QML
7
star
64

skill-personal

Mycroft AI official Personality Skill - answers basic personality questions around Mycroft
Python
7
star
65

skill-date-time

Mycroft AI official Date and Time Skill, providing the current time, date and day of week for cities around the world.
Python
6
star
66

mycroft-gui-mark-2

QML
6
star
67

skill-playback-control

Mycroft AI official Playback Control Skill - providing Intents for other Skills to use common playback functionality (via Common Play)
QML
6
star
68

skill-spelling

Mycroft AI spelling Skill
Python
6
star
69

skill-ip

Mycroft AI official IP Skill - find the IP address of your Device
Python
5
star
70

skill-fallback-persona

Mycroft AI official Persona Skill - used as a fallback if the Utterance can't be matched to an Intent
Python
5
star
71

mark-ii-sandbox

Image for the Mark II based on Raspberry Pi OS
Python
5
star
72

skill-configuration

Mycroft AI official Configuration Skill - synchronize settings with home.mycroft.ai
Python
5
star
73

docker-openvpn-client

An OpenVPN client built into a docker container. Allows for attaching other containers to a VPN
Shell
5
star
74

skill-query

Skill Negotiating for the best source for an answer via Common QA
Python
5
star
75

mimic1-packaging

Shell
5
star
76

skill-pairing

Mycroft AI official Pairing Skill - connect your Device to home.mycroft.ai
QML
5
star
77

skill-speak

Mycroft AI official Speak Skill - make Mycroft speak back text
Python
5
star
78

mycroft-wifi-setup

Mycroft WiFi Setup Client
Python
4
star
79

respeaker-dev-filesystem

Development file system for Seeed ReSpeaker Core v2
4
star
80

mimic1-full

Build mimic (without runtime plugins if desired)
C
4
star
81

pako

The universal package manager library
Python
4
star
82

fallback-unknown

Mycroft AI official Unknown Fallback Skill - used if no Intent is matched to an Utterance
Python
4
star
83

arriz

A real-time array visualization tool
Python
4
star
84

skill-release-test

Mycroft AI official Release Test Skill - used during `mycroft-core` release testing
Python
4
star
85

mycroft-mark-1

Mycroft AI official Mark 1 Skill - control the Mark 1 enclosure
Python
4
star
86

rnn-demo

Demo of using various recurrent networks to make streaming predictions
Python
4
star
87

skill-support

Mycroft AI official Support Skill - create information for a support request using voice
Python
3
star
88

mycroft-devices

Shell
3
star
89

skill-send-sms

Python
3
star
90

design

Place to share designy things from Mycroft.
3
star
91

mycroft-core-release

A project to automate the mycroft-core release process.
Python
3
star
92

mimic1-documentation

Documentation for https://github.com/mycroftai/mimic1
3
star
93

skill-naptime

Mycroft AI official Naptime Skill - put Mycroft to sleep for a while
Python
3
star
94

mimic1-english

English language support for the mimic TTS system
C
3
star
95

ZZZ-RETIRED__chatter

A Mycroft AI chatbot solution framework
3
star
96

skill-repeat-interactions

Mycroft AI official Repeat Interaction Skill - repeat recent commands
Python
3
star
97

mark-ii-product

Software packaging for the default Mark II operating system.
C
2
star
98

skill-version-checker

Mycroft AI official Version Checker Skill - check the version of mycroft-core that is installed
Python
2
star
99

skill-dial-call

Python
2
star
100

skill-standard-gui

Handles standard, non-platform-specific GUI activities.
Python
2
star