生成语音数字mp3文件用于记忆比赛

spokennumbers的Python项目详细描述


生成语音数字mp3文件用于记忆比赛和训练。在

用法和命令行选项

usage: spokennumbers [-h] [-n NUMBERS] [-p INIT_SILENCE] [-c] [-s SPEED]
                    [-d SOURCE] [-e EXCLUDE] [-o OUTPUT_FILE] [-i]

Generate spoken numbers audio files.

If no options are provided, a random 100-digit mp3 file will be created.
A text file will also be created next to the mp3 file contaning the raw
numbers (used for recall).

optional arguments:
-h, --help            show this help message and exit
-n NUMBERS, --numbers NUMBERS
                        The number of random digits to generate. Defaults to
                        100. If a text file is specified, all digits it
                        contains will be used instead (parsed by regexp).
-p INIT_SILENCE, --init-silence INIT_SILENCE
                        Add some seconds of silence in the beginning of the
                        audio file. Defaults to 3 seconds.
-c, --skip-countdown  By default, a countdown sequence will be spoken at
                        start: "3 ... 2 ... 1 ... a ... b ... c ... ...". This
                        option skips the countdown.
-s SPEED, --speed SPEED
                        The pace at which numbers will be spoken in seconds.
                        Defaults to one digit per second.
-d SOURCE, --source SOURCE
                        Audio files source. The string "default" will use the
                        default audio files included in the Python package.
                        For custom audio files, you can specify the path to a
                        directory as source. The directory must contain the
                        required audio wav files: 0.wav ... 9.wav and a.wav,
                        b.wav and c.wav.
-e EXCLUDE, --exclude EXCLUDE
                        This option is used to exclude specified digits from
                        the output. For example, if `--exclude 789` is used,
                        the digits 7, 8 and 9 will not be present in the
                        output file.
-o OUTPUT_FILE, --output-file OUTPUT_FILE
                        Name of output file. Defaults to `spoken.mp3`.
-i, --skip-txt-file   Do not create the txt file containing the spoken
                        numbers next to the audio file. The txt file is used
                        for recall.

Example:
    $ spokennumbers -n 150 --speed 1.2 -o monday_training.mp3

安装

来自PyPI:

^{pr2}$

或从源(请确保先有python3 -m pip install wheel setuptools):

$ git clone https://github.com/Penlect/spokennumbers.git
$ cd spokennumbers
$ python3 setup.py bdist_wheel
$ python3 -m pip install ./dist/spokennumbers-*.whl

或从生成的Debian包:

# Install build dependencies
$ sudo apt install python3-all python3-setuptools dh-python
$ git clone https://github.com/Penlect/spokennumbers.git
$ cd spokennumbers
$ make deb
$ sudo apt install ./python3-spokennumbers_*.deb

注意:此项目与pydub有依赖关系,需要安装ffmpeg。 安装ffmpeg,并确保它在路径中可用。在

变更日志

变更日志保存在debian目录下,请检查:changelog。在

欢迎加入QQ群-->: 979659372 Python中文网_新手群

推荐PyPI第三方库


热门话题
通过GWT JSNI传递Java对象时发生javascript错误   java Spring启动项目wildfly服务器失败   java如何进行会话来存储Id?   javajpa/hibernate如何通过带注释的外键映射元素集合   Java将字节[]转换为双[],反之亦然   eclipse显示Java双值   java如何正确读取socket数据包   是否存在用于集合处理的Java库?   javacom。太阳jna。无法将指针强制转换为com。太阳jna。站台win32。温迪夫。LPARAM   java Eclipse插件开发。我可以在插件中使用已经存在的jar文件吗?   分析Java错误:找不到符号变量   java如何使按钮摆动以进行大的处理   如何通过传递bucket name和file name从java中的minio服务器下载多个文件   JavaScrollPane JavaFX使其滚动更多?   java无法加载C:\Users\username\AppData\Local\Android\Sdk\buildtools\28.0.3\lib\dx。罐子   JavaSwing中是否有一个“组框”等价物?   java使用slf4j和log4j与单独使用log4j相比,是否存在性能开销?   java模式和匹配:格式化文本文件   JTable行增长的java问题