Welcome to rvTTS’s documentation!

rvTTS is a cli tool for converting text to mp3 files using ResponsiveVoice’s API.

Installation

You can install rvTTS from command line:

pip install rvtts

Usage

rvtts

Convert text or input file to to mp3 using ResponsiveVoice’s API.

rvtts [OPTIONS]

Options

-l, --lang

Print all supported voice.

-t, --text <text>

Text to convert.

-i, --input <input>

Input file. For example: -i doc-ton-tam-gioi-chuong-0001.txt

-o, --output <output>

Output file. For example: -o doc-ton-tam-gioi-chuong-0001.mp3 [required]

-v, --voice <voice>

Output voices. For example: -v vietnamese_male [required]

--pitch <pitch>

Adjust pitch (range 0 to 1). Default: 0.5

--rate <rate>

Adjust rate (range 0 to 1). Default: 0.5

--volume <volume>

Adjust volume (range 0 to 1). Default: 1

-d, --debug

Debug mode.

--version

Show the version and exit.

rvtts.rvtts.responsiveVoice

class rvtts.rvtts.responsiveVoice(text='', pitch=0.5, rate=0.5, vol=1, pre_processor_funcs=[<function tone_marks>, <function end_of_line>, <function abbreviations>, <function word_sub>], tokenizer_func=<bound method Tokenizer.run of re.compile('(?<=\?).|(?<=!).|(?<=?).|(?<=!).|(?<!\.[a-z])\. |(?<!\.[a-z]), |(?<!\d):|¿|\)|;|\[|、|¡|،|‥|—|。|\]|:|…|\(|,|\n', re.IGNORECASE) from: [<function tone_marks>, <function period_comma>, <function colon>, <function other_punctuation>]>)

rvTTS

A CLI tool to convert text to MP3 using ResponsiveVoice’s API.

Parameters
  • text (string) – text to be converted.

  • pitch (float, optional) – adjust pitch output. Default is 0.5.

  • rate (float, optional) – adjust rate output. Default is 0.5.

  • vol (float, optional) – adjust volume output. Default is 1.

get_mp3(output_file='', voice_name='english_us_male', pitch=0.5, rate=0.5, volume=1)

Call the API and write to file.

Parameters
  • output_file (string) – Filename to write to.

  • voice_name (string) – voice name. Default is english_us_male. Use rvtts –lang to get all supported voices.

  • pitch (float, optional) – adjust pitch output. Default is 0.5.

  • rate (float, optional) – adjust rate output. Default is 0.5.

  • vol (float, optional) – adjust volume output. Default is 1.

Examples

Convert from stdin to hello.mp3

rvtts --text "hello wold" -o hello.mp3

Convert Vietnamese text

rvtts --text "một hai ba bốn năm sáu" -o test.mp3 -v vietnamese_female

Convert from chuong-0001.txt to chuong-0001.mp3 using voice vietnamese_male

rvtts -i chuong-0001.txt -o chuong-0001.txt -v vietnamese_male

License

MIT License

Copyright (c) 2019 Tino Khong

Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

Credits

Changelog

1.0

  • Initial release