我正在尝试在我的 vb 应用程序中创建文本到语音功能。
创建文本到语音的默认方法:
Dim SAPI
SAPI = CreateObject("SAPI.spvoice")
SAPI.Speak(TextBox1.Text)
这种方法不适合我正在做的事情。
假设我有 4 个音频剪辑,剪辑的名称是:
ba.wav
ba sound.wav
a sound卡瓦夫
ka soundja.wav
ja sound
假设我现在有 4 个字符,这些字符是:
微米
to represent the ba soundö
to represent the a sound❗️
to represent the ka sound◊◊
to represent the ja sound
我有RichTextBox一个RichTextBox1
可以输入µ,ö,姫,◊◊四个字符RichTextBox1
我现在有这个
Private Sub SpeakButton_Click(sender As Object, e As EventArgs) Handles SpeakButton.Click
' how do i get each character in RichTextBox1 to play when this button is clicked
End Sub
我不确定,但我相信应该将某种 wav 音频文件分配给相应的角色
我知道我可以使用这种方法播放 wav 文件
My.Computer.Audio.Play(My.Resources.WAV-NAME, AudioPlayMode.Background)
因此,如果输入的文本RichTextBox1 是◊◊ߧµ,则生成的语音输出应该听起来JAKABA