liepa项目立陶宛语言合成器的python绑定

liepa-tts的Python项目详细描述


LIEPA

立陶宛语音控制服务

该项目旨在提供高品质的立陶宛数字语音服务。 免费的。 到目前为止,在不同的完整性阶段提供了几种服务, 如立陶宛语语音识别器和立陶宛语语音合成器。

这个包裹包裹住了后者。

依赖关系

要使这个包(liepa tts)工作,您需要合成器二进制文件,您将 必须自己编译。

可以获得原始源here

为了使为windows以外的平台构建二进制文件更容易,您可以 在这里获取固定源:laba-diena-tts

从本机模块子树构建二进制文件后,请确保它们是 在库路径(用于构建)和库路径(用于运行时)上可用。

安装

我强烈推荐Poetry

poetry add liepa-tts

如果必须,请使用pip:

pip install liepa-tts

您需要numpy来构建c扩展,因此如果您遇到错误,请首先安装:

pip install numpy

用法

fromliepa_ttsimportliepa# All strings must be encoded with Windows Baltic encodingENCODING="cp1257"# First parameter is the path to data directory# Second parameter is the path to voice directory# All paths must include trailing slash# Returns error codeliepa.init("data/".encode(ENCODING),"data/Edvardas/".encode(ENCODING))# Parameters:# text: String that will be syntesized# outSize: Integer. Typically this takes ~3072 per phoneme (letter), if it's too small you'll get buffer overflow errors# speed: Integer. The larger the value the slower the voice will talk. Can be negative.# tone: Integer. The pitch. Larger values make for higher pitch. Can be negative.# Returns tuple (error code, ndarray). ndarray contains wav data without headers as array of integers.text="Laba diena. Kaip jums sekasi?".encode(ENCODING)err,buff=liepa.synth(text,len(text)*3072,100,0)# Parameters:# buff: The ndarray returned by liepa.synth() method# filename: encoded path to output fileliepa.toWav(buff,"test.wav".encode(ENCODING))# Call this when you're done to free resourcesliepa.unload()
注意:

合成器产生的错误代码定义在 include/LithUSS_Error.h如果你需要更多关于 你得到的错误检查那个文件。

您可以获取数据文件以及原始源here

必须存在于data/目录中的文件是:

  • abb.txt
  • duom.txt
  • rules.txt
  • skaitm.txt

你应该提取未经修改的语音目录。

合成器产生的.wav完全未优化,包含 一片寂静。因此在使用前应进一步处理。

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

推荐PyPI第三方库


热门话题
正则表达式使用Java从服务器截断文本   micronaut微服务的java内存消耗   如果私有函数需要相同的输入,java应该在公共函数中显式执行异常检查   为什么我们在java中使用抽象类和抽象方法   Java中接受外来字母的字符串?   cordova Android:ClassNotFoundException,包括ZXing   通过LiveData observer向特定索引添加项时出现java IndexOutOfBoundsException   jsp Java从两个源调用一个servlet   java如何设置网格布局中按钮的位置?   java HashMap返回方法   java JDK错误版本   java如何将现有类集成到新的Swing项目中   java如何在扫描程序位于输入端时使for循环停止   java正则表达式匹配空白表   java组织。格拉德尔。工具。BuildException:设置的代码长度无效   JList中的swing Java格式化字符串   javabeans如何将JavaBean属性映射到另一个名称以进行输出?   ajax请求后的java Rerender RichFaces错误消息