{"id":13434907,"url":"https://github.com/MycroftAI/mimic1-core","last_synced_at":"2025-03-18T02:30:32.493Z","repository":{"id":84343411,"uuid":"99779967","full_name":"MycroftAI/mimic1-core","owner":"MycroftAI","description":"Core of the mimic TTS system","archived":false,"fork":false,"pushed_at":"2018-06-16T15:30:26.000Z","size":1325,"stargazers_count":14,"open_issues_count":7,"forks_count":11,"subscribers_count":9,"default_branch":"development","last_synced_at":"2025-03-03T03:41:38.639Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MycroftAI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"COPYING","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2017-08-09T07:46:22.000Z","updated_at":"2023-08-03T13:28:02.000Z","dependencies_parsed_at":"2023-07-06T22:16:07.192Z","dependency_job_id":null,"html_url":"https://github.com/MycroftAI/mimic1-core","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MycroftAI%2Fmimic1-core","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MycroftAI%2Fmimic1-core/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MycroftAI%2Fmimic1-core/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MycroftAI%2Fmimic1-core/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MycroftAI","download_url":"https://codeload.github.com/MycroftAI/mimic1-core/tar.gz/refs/heads/development","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244143835,"owners_count":20405284,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-07-31T03:00:26.715Z","updated_at":"2025-03-18T02:30:32.100Z","avatar_url":"https://github.com/MycroftAI.png","language":"C","funding_links":[],"categories":["C"],"sub_categories":[],"readme":"# Mimic - The Mycroft TTS Engine\n\n[![Build Status](https://travis-ci.org/MycroftAI/mimic-core.svg?branch=development)](https://travis-ci.org/MycroftAI/mimic-core)\n[![codecov.io](https://codecov.io/github/MycroftAI/mimic-core/coverage.svg?branch=development)](https://codecov.io/github/MycroftAI/mimic-core?branch=development)\n\nMimic is a fast, lightweight Text-to-speech engine developed by [Mycroft A.I.](https://mycroft.ai/) and [VocaliD](https://vocalid.co/), based on Carnegie Mellon University’s [Flite (Festival-Lite)](http://www.festvox.org/flite) software. Mimic takes in text and reads it out loud to create a high quality voice. \n\nThis repository only contains the core of mimic. If you want to get all the language\nsupport and voices, please check out the [mimic-full](https://github.com/MycroftAI/mimic-full) repository,\nthat builds mimic with all the language support and voices at once.\n\nMore information of mimic at: [mimic.mycroft.ai](https://mimic.mycroft.ai/)\n\n## Supported platforms\n\n- Linux (ARM \u0026 Intel architectures)\n- Mac OS X\n- Windows\n\n**Untested**\n- Android\n\n**Future**\n- iOS\n\n## Requirements\n\nThis is the list of requirements. Below there is the commands needed on the most\npopular distributions and supported OS.\n\n- A C compiler:\n  * Linux or Mac OSX: _Recommended:_ gcc or clang\n  * Windows: _Recommended:_ GCC under [mingw64](https://mingw-w64.org)\n- [ninja](https://ninja-build.org/)\n- pkg-config\n- An audio engine:\n  * Linux: ALSA/PortAudio/PulseAudio (_Recommended:_ ALSA)\n  * Mac OSX: PortAudio\n  * Windows: PortAudio or WinMME (_Recommended:_ PortAudio)\n- Optionally, PCRE2 library and headers (they are compiled otherwise)\n- Optionally, The HTSEngine library and headers (they are compiled otherwise)\n\n## Dependencies:\n\n### Linux\n\n##### On Debian/Ubuntu\n```\nsudo apt-get install gcc pkg-config libasound2-dev python3-pip ninja-build\npip3 install --user meson\n```\n\n##### On Fedora\n```\nsudo dnf install gcc pkgconfig alsa-lib-devel python3-pip ninja-build\npip3 install --user meson\n```\n\n##### On Arch\n```\nsudo pacman -S --needed install gcc pkg-config alsa-lib python-pip ninja\npip3 install --user meson\n```\n\n### Mac OSX\n\n- Install *Brew*\n  ```\n  /usr/bin/ruby -e \"$(curl -fsSL https://raw.githubusercontent.com/Homebrew/install/master/install)\"\n  ```\n\n- Install *python3*, *ninja*, *pkg-config*, *pcre2* and *PortAudio*\n  ```\n  brew install python3 ninja pkg-config pcre2 portaudio\n  pip3 install --user meson\n  ```\n\n### Windows\n\n#### Cross compiling:\n\nThe fastest and most straightforward way to build mimic for windows is by\ncross-compilation from linux. This requires some additional packages to be\ninstalled.\n\nOn Ubuntu:\n\n```\nsudo apt-get install binutils-mingw-w64-x86-64 mingw-w64-x86-64-dev gcc-mingw-w64-x86-64\n```\n\n#### Native build\n\nInstall mingw-w64, ninja-build and meson. Install the portaudio library and headers\noptionally as well.\n\n## Build\n\n- **Regular:**\n```\nmeson build --prefix=\"$PWD/install\" # Choose any installation prefix you want\nninja -C build\nninja -C build install # Depending on the prefix, this may need sudo privileges.\n```\n\n- **Cross compilation Ubuntu -\u003e Windows:**\n```\nmeson build --prefix=\"$PWD/install\" --cross-file=\"cross/ubuntu-mingw64.txt\"\nninja -C build install\n```\n\n## Usage\n\nBy default mimic will play the text using an audio device. Alternatively it can\noutput the wave file in RIFF format (often called `.wav`).\n\n#### Read text\n\n- To an audio device\n  ```\n  $ ./mimic -t TEXT\n  ```\n  \n  **_Example_**\n  ```\n  $ ./mimic -t \"Hello. Doctor. Name. Continue. Yesterday. Tomorrow.\"\n  ```\n\n- To an audio file\n  ```\n  $ ./mimic -t TEXT -o WAVEFILE\n  ```\n  \n  **_Example_**\n  ```\n  $ ./mimic -t \"Hello. Doctor. Name. Continue. Yesterday. Tomorrow.\" -o hello.wav\n  ```\n\n#### Read text from file\n\n- To an audio device\n  ```\n  $ ./mimic -f TEXTFILE\n  ```\n  \n  **_Example_**\n  ```\n  $ ./mimic -f doc/alice\n  ```\n\n- To an audio file\n  ```\n  $ ./mimic -f TEXTFILE -o WAVEFILE`\n  ```\n  **_Example_**\n  ```\n  $ ./mimic -f doc/alice -o hello.wav\n  ```\n\n#### Change voice\n\n- List available internal voices\n  ```\n  $ ./mimic -lv\n  ```\n\n- Use an internal voice\n  ```\n  $ ./mimic -t TEXT -voice VOICE\n  ```\n  \n  **_Example_**\n  ```\n  $ ./mimic -t \"Hello\" -voice slt\n  ```\n\n- Use an external voice file\n  ```\n  $ ./mimic -t TEXT -voice VOICEFILE\n  ```\n  \n  **_Example_**\n  ```\n  $ ./mimic -t \"Hello\" -voice voices/cmu_us_slt.flitevox\n  ```\n\n- Use an external voice url\n  ```\n  $ ./mimic -t TEXT -voice VOICEURL\n  ```\n  \n  **_Example_**\n  ```\n  $ ./mimic -t \"Hello\" -voice http://www.festvox.org/flite/packed/flite-2.0/voices/cmu_us_ksp.flitevox\n  ```\n\n###### Notes\n\n- mimic offers several voices that can use different speech modelling techniques\n  (diphone, clustergen, hts). Voices can differ a lot on size, naturalness and\n  intelligibility.\n\n  * Diphone voices are less computationally expensive and quite intelligible but\n    they lack naturalness (sound more robotic). e.g. `./mimic -t \"Hello world\" -voice kal16`\n\n  * clustergen voices can sound more natural and intelligible at the expense of\n    size and computational requirements. e.g.:  e.g. `./mimic -t \"Hello world\" -voice slt`, `./mimic -t \"Hello world\" -voice ap`\n\n  * hts voices usually may sound a bit more synthetic than clustergen voices,\n    but have much smaller size. e.g.:  e.g. `./mimic -t \"Hello world\" -voice slt_hts`\n\n- Voices can be compiled (built-in) into mimic or loaded from a `.flitevox` file.\n  The only exception are hts voices. hts voices combine both a compiled function with\n  a voice data file `.htsvoice`. Mimic will look for the `.htsvoice` file when\n  the hts voice is loaded, looking into the current working directory, \n  the \"voices\" subdirectory and the `$prefix/share/mimic/voices` directory if it\n  exists.\n\n- Voice names are identified as loadable files if the name includes a \"`/`\" \n  (slash) otherwise they are treated as internal compiled-in voices.\n\n- The `voices/` directory contains several flitevox voices. Existing Flite voices\n  can be found here: [http://www.festvox.org/flite/packed/flite-2.0/voices/](http://www.festvox.org/flite/packed/flite-2.0/voices/)\n\n- The voice referenced via an url will be downloaded on the fly.\n\n#### Other options\n\nVoices accept additional *debug* options. specified as `--setf feature=value` in the\ncommand line. Wrong values can prevent mimic from working. Some speech modelling\ntechniques may not implement support for changing these features so at some point\nsome voices may not provide support for these options. Here are some examples:\n\n- Use simple concatenation of diphones without prosodic modification\n  ```\n  ./mimic --sets join_type=simple_join doc/intro.txt\n  ```\n\n- Print sentences as they are said\n  ```\n  ./mimic -pw doc/alice\n  ```\n\n- Make it speak slower\n  ```\n  ./mimic --setf duration_stretch=1.5 doc/alice\n  ```\n\n- Make it speak faster\n  ```\n  ./mimic --setf duration_stretch=0.8 doc/alice\n  ```\n\n- Make it speak higher\n  ```\n  ./mimic --setf int_f0_target_mean=145 doc/alice\n  ```\n\nSee `lang/cmu_us_kal/cmu_us_kal.c`) to see some other features and values.\n\n\n#### Say the hour\n\n- The talking clock requires a single argument HH:MM. Under Unix you can call it\n  ```\n  ./mimic_time `date +%H:%M` \n  ```\n\n#### Benchmarking\n\n- For benchmarking, \"none\" can be used to discard the generated audio and give a summary of the speed:\n  ```\n  ./mimic -f doc/alice none\n  ```\n\n## How to Contribute \n\nFor those who wish to help contribute to the development of mimic there are a few things to keep in mind. \n  \n#### Git branching structure\nWe will be using a branching struture similar to the one described in [this article](http://nvie.com/posts/a-successful-git-branching-model/)\n  \n##### In short\n\n- `master` branch is for stable releases, \n  \n- `development` branch is where development work is done between releases,\n  \n- Any feature branch should branch off from `development`, and when complete will be merged back into `development`.\n  \n- Once enough features are added or a new release is complete those changes in `development` will be merged into `master`, \n  then work can continue on `development` for the next release. \n\n\n#### Coding Style Requirements\nTo 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.\n\n- **Indentation**\n\n  Each level of indentation is *4 spaces*.\n\n- **Braces**\n\n  Braces always comes on the line following the statement.\n\n  **_Example_**\n\n  ```c\n  void cool_function(void)\n  {\n      int cool;\n      for (cool = 0; cool \u003c COOL_LIMIT; cool++)\n      {\n          [...]\n          if (cool == AWESOME)\n          {\n              [...]\n          }\n      }\n  }\n  ```\n\n- **If-statements**\n\n  Always use curly braces.\n  \n  **_Example_**\n\n  ```c\n  if(condition)\n  {                             /*always use curly braces even if the 'if' only has one statement*/\n      DoJustThisOneThing();        \n  }\n  \n  if(argv[i][2] == 'h' \u0026\u0026      /*split 'if' conditions to multiple lines if the conditions are long */\n     argv[i][3] == 'e' \u0026\u0026      /*or if it makes things more readable. */\n     argv[i][4] == 'l' \u0026\u0026 \n     argv[i][5] == 'p')\n  {\n        /*example taken from args parsing code*/\n        /* code */\n  }\n  else if(condition)\n  {\n        /* code */\n  }\n  else\n  {\n      /* code */\n  }\n  ```\n  \n- **Switch-statements**\n\n  Always keep the break statement last in the case, after any code blocks.\n\n  **_Example_**\n\n  ```c\n  switch(state)\n  {\n      case 1:\n      {               /* even if the case only has one line, use curly braces (similar reasoning as with if's) */ \n          doA(1);\n      } break;\n                          /* separate cases with a line */\n      case 2:             /* unless it falls into the next one */\n      case 3:\n      {\n          DoThisFirst();\n      }                   /* no break, this one also falls through */\n      case 4:\n      {                   /* notice that curly braces line up with 'case' on line above */\n          int b = 2;\n          doA(b);\n      } break;        /* putting 'break' on this line saves some room and makes it look a little nicer */\n  \n      case 5:\n      {\n          /* more code */\n      } break;\n  \n      default:        /* It is nice to always have a default case, even if it does nothing */\n      {\n          InvalidDefaultCase(); /* or whatever, it depends on what you are trying to do. */\n      }\n  }\n  ```\n\n\n- **Line length**\n\n  There's no hard limit but if possible keep lines shorter than *80 characters*.\n\n##### Vimrc \n\n For those of you who use vim, add this to your vimrc to ensure proper indenting.\n\n ```vimrc\n\"####Indentation settings\n:filetype plugin indent on\n\" show existing tab with 4 spaces width\n:set tabstop=4\n\" when indenting with '\u003e', use 4 spaces width\n:set shiftwidth=4\n\" On pressing tab, insert 4 spaces\n:set expandtab\n\" fix indentation problem with types above function name\n:set cinoptions+=t0\n\" fix indentation of { after case\n:set cinoptions+==0\n\" fix indentation of multiline if\n:set cinoptions+=(0   \"closing ) to let vimrc hylighting work after this line\n\n\"see http://vimdoc.sourceforge.net/htmldoc/indent.html#cinoptions-values\n\"for more indent options\n ```\n\n##### Indent command (currently does not indent switch/cases properly)\n\n```\nindent [FILE] -npcs -i4 -bl -Tcst_wave -Tcst_wave_header -Tcst_rateconv \\\n      -Tcst_voice -Tcst_item -Tcst_features -Tcst_val -Tcst_va -Tcst_viterbi \\\n      -Tcst_utterance -Tcst_vit_cand_f_t -Tcst_vit_path_f_t -Tcst_vit_path \\\n      -Tcst_vit_point -Tcst_string -Tcst_lexicon -Tcst_relation \\\n      -Tcst_voice_struct -Tcst_track -Tcst_viterbi_struct -Tcst_vit_cand \\\n      -Tcst_tokenstream -Tcst_tokenstream_struct -Tcst_synth_module \\\n      -Tcst_sts_list -Tcst_lpcres -Tcst_ss -Tcst_regex -Tcst_regstate \\\n      -Twchar_t -Tcst_phoneset -Tcst_lts_rewrites -Tlexicon_struct \\\n      -Tcst_filemap -Tcst_lts_rules -Tcst_clunit_db -Tcst_cg_db \\\n      -Tcst_audio_streaming_info -Tcst_audio_streaming_info_struct -Tcst_cart \\\n      -Tcst_audiodev -TVocoderSetup -npsl -brs -bli0 -nut\n```\n\n## Acknowledgements\nsee [ACKNOWLEDGEMENTS](https://github.com/MycroftAI/mimic/blob/master/ACKNOWLEDGEMENTS)\n\n## License\nSee [COPYING](https://github.com/MycroftAI/mimic/blob/master/COPYING)\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMycroftAI%2Fmimic1-core","html_url":"https://awesome.ecosyste.ms/projects/github.com%2FMycroftAI%2Fmimic1-core","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2FMycroftAI%2Fmimic1-core/lists"}