我正在尝试将语音识别和说话人智能化技术结合起来,以确定对话中有多少发言者以及哪位发言者说了什么.
为此我使用CMU Sphinx和LIUM Speaker Diarization.
我可以单独运行这两个工具,即我可以运行Sphinx 4并从音频获取文本输出并运行LIUM工具包并获取音频片段.
现在我想结合这两个并获得如下输出:
s0 : this is my first sentence.
s1 : this is my reply.
s2: i do not what you are talking about
Run Code Online (Sandbox Code Playgroud)
有谁知道如何结合这两个工具包?
我正在尝试在JAVASCRIPT中编写一个代码,它使用语音输入并将其转换为文本并将此文本放入textarea(HTML).我的代码如下所示.按钮看起来有点奇怪(比平时小),当你点击它时,它根本无法正常工作.请帮忙.
我的代码如下:
<textarea id="textarea" rows=10 cols=80></textarea>
<button id="button" onclick="toggleStartStop()"></button>
<script type="text/javascript">
var recognizing;
var recognition = new SpeechRecognition();
recognition.continuous = true;
reset();
recognition.onend = reset();
recognition.onresult = function (event) {
for (var i = resultIndex; i < event.results.length; ++i) {
if (event.results.final) {
textarea.value += event.results[i][0].transcript;
}
}
}
function reset() {
recognizing = false;
button.innerHTML = "Click to Speak";
}
function toggleStartStop() {
if (recognizing) {
recognition.stop();
reset();
} else {
recognition.start();
recognizing = true;
button.innerHTML = "Click to …Run Code Online (Sandbox Code Playgroud) 任何人都可以解释我如何使用pocketsphinx将我的演讲转换成文本吗?我试试这个:
import com.example.speechtutor.SpeechRecognizerRecorder;
import com.example.speechtutor.SpeechRecognizerRecorderSetup;
import edu.cmu.pocketsphinx.Hypothesis;
import edu.cmu.pocketsphinx.RecognitionListener;
import static edu.cmu.pocketsphinx.Assets.syncAssets;
public class SpeakActivity extends Activity implements RecognitionListener {
SpeechRecognizerRecorder recognizer;
private File appDir;
String filePath;
private static final String KWS_SEARCH_NAME = "wakeup";
private static final String FORECAST_SEARCH = "forecast";
private static final String DIGITS_SEARCH = "digits";
private static final String MENU_SEARCH = "menu";
private static final String KEYPHRASE = "hello";
@Override
public void onCreate(Bundle savedInstanceState) {
super.onCreate(savedInstanceState);
setContentView(R.layout.activity_speak);
try {
Log.d("Tag","before trying to sync assets");
appDir = syncAssets(getApplicationContext()); …Run Code Online (Sandbox Code Playgroud) 我第一次尝试音频到文本.
import speech_recognition as sr
r = sr.Recognizer()
with sr.AudioFile("/path/to/.mp3") as source:
audio = r.record(source)
Run Code Online (Sandbox Code Playgroud)
当我执行上面的代码时,会发生以下错误,
<ipython-input-10-72e982ecb706> in <module>()
----> 1 with sr.AudioFile("/home/yogaraj/Documents/Python workouts/Python audio to text/show_me_the_meaning.mp3") as source:
2 audio = sr.record(source)
3
/usr/lib/python2.7/site-packages/speech_recognition/__init__.pyc in __enter__(self)
197 aiff_file = io.BytesIO(aiff_data)
198 try:
--> 199 self.audio_reader = aifc.open(aiff_file, "rb")
200 except aifc.Error:
201 assert False, "Audio file could not be read as WAV, AIFF, or FLAC; check if file is corrupted"
/usr/lib64/python2.7/aifc.pyc in open(f, mode)
950 mode = 'rb'
951 …Run Code Online (Sandbox Code Playgroud) 使用 LIUM Speaker Diarization 工具包,我如何知道哪个演讲者发言了多长时间?
例如,这是我的 .seg 文件。
;; cluster S0 [ score:FS = -33.93166562542459 ] [ score:FT =
-34.24966646974656 ] [ score:MS = -34.05223781565528 ] [ score:MT =
-34.32834794609819 ]
Seq06 1 0 237 F S U S0
Seq06 1 2960 278 F S U S0
;; cluster S1 [ score:FS = -33.33289449700619 ] [ score:FT =
-33.64489165914674 ] [ score:MS = -32.71833169822944 ] [ score:MT =
-33.380835069917275 ]
Seq06 1 238 594 M S U S1
Seq06 1 …Run Code Online (Sandbox Code Playgroud) 我第一次用 C 语言编写音频文件。我发现这段代码应该读取一个音频文件,然后编写一个包含多个信息的 csv 文件以分析音频波,以防万一将是一个简单的声音:我对波的振幅感兴趣,在音色中的声音及其高度和延伸。
main () {
// Create a 20 ms audio buffer (assuming Fs = 44.1 kHz)
int16_t buf[N] = {0}; // buffer
int n; // buffer index
// Open WAV file with FFmpeg and read raw samples via the pipe.
FILE *pipein;
pipein = popen("ffmpeg -i whistle.wav -f s16le -ac 1 -", "r");
fread(buf, 2, N, pipein);
pclose(pipein);
// Print the sample values in the buffer to a CSV file
FILE *csvfile;
csvfile = fopen("samples.csv", "w"); …Run Code Online (Sandbox Code Playgroud) 目前,我们正在研究使用sphinx4进行语音识别.我们正在尝试为听写类型应用程序实现良好的响应.输入是一个wav文件,我们希望转录它.我查看了Sphinx4提供的LatticeDemo和Transcriber演示.当我使用相同的配置时,响应非常差.我试图调整配置文件,但它根本无法识别单词.提供的转录器演示是为数字,我修改了配置文件以理解单词.但我不确定我是否遗漏了一些东西.我已经附加了配置文件.请提出可以进行的任何改进.
<config>
<!-- ******************************************************** -->
<!-- frequently tuned properties -->
<!-- ******************************************************** -->
<property name="absoluteBeamWidth" value="500"/>
<property name="relativeBeamWidth" value="1E-60"/>
<property name="absoluteWordBeamWidth" value="20"/>
<property name="relativeWordBeamWidth" value="1E-40"/>
<property name="wordInsertionProbability" value="1E-16"/>
<property name="languageWeight" value="7.0"/>
<property name="silenceInsertionProbability" value=".1"/>
<property name="frontend" value="epFrontEnd"/>
<property name="recognizer" value="recognizer"/>
<property name="showCreations" value="false"/>
<!-- ******************************************************** -->
<!-- word recognizer configuration -->
<!-- ******************************************************** -->
<component name="recognizer"
type="edu.cmu.sphinx.recognizer.Recognizer">
<property name="decoder" value="decoder"/>
<propertylist name="monitors">
<item>accuracyTracker </item>
<item>speedTracker </item>
<item>memoryTracker </item>
<item>recognizerMonitor </item>
</propertylist>
</component>
<!-- ******************************************************** -->
<!-- The Decoder configuration --> …Run Code Online (Sandbox Code Playgroud) 我想建立一个应用程序,分析麦克风的语音情感内容.
虽然有时用作额外的特征,但它不涉及语音识别.情绪分析基于声音的韵律特征(音高变化,速度等,音调).
我知道这可以在台式计算机上完成,但我不希望用户必须将他们的录音(电话交谈)上传到服务器以获得情绪反馈.
我需要的是一个API,它提供整个分析或API,我可以用来提取这些功能(即对话的平均速度).
那里有这样的东西吗?
提前致谢!
我正在使用Mono和Monodevelop在Linux(KUbuntu)上开展一个项目.我想使用System.Speech库,完全可以在Windows 7上使用Unity中的Monodevelop.在过去的几个小时里,我一直在网上做很多工作,据我所知,System.Speech WAS添加到单声道.
我更新了所有单声道,mono --version显示4.0.2(最新版本),Monodevelop版本显示5.9.4(据我所知,这也是最新版本).这让我觉得我拥有所有开发软件的所有最新更新.
我重新启动,创建新项目,从git手动构建monodevelop,我能想到的一切.一切都完成了,我右键单击References => Edit References => System.Speech,没有任何显示.我再次通过在我的Windows机器上的Unity上进行双重检查,它肯定存在.
有谁知道发生了什么事?我不确定要为这样的东西提供什么其他细节,但我显然遗漏了一些东西.我非常乐意发布您需要的任何其他信息,我非常感谢您的任何帮助!
我想使用CMU sphinx4来转录给定的音频文件.它应该采用.wav格式的音频文件,并用印度英语进行对话.我是CMUSphinx的新手,无法轻易逐步描述该过程.
我已经阅读了一些关于语音/语音识别的内容,我想知道它是如何工作的。例如,Android 和类似情况下的“ok Google”?
我想知道它是如何工作的(如何区分和分析连续馈送中的单词,以找到它的关键字)。如果我认为它是一个连续的文本提要,一种方法是隔离给定长度的提要,然后找到一个关键字。音频提要有点难以理解,因为单词之间没有纯粹的沉默(如上所述)并且隔离给定的长度并不能保证在所选子提要的开头或结尾剪切关键字。它是如何工作的?
最后,如果你们知道一些能够做到这一点的库(如果可能的话,C/C++),我会很高兴实现一个“关键字检测器”。
谢谢你。
我已经在 python 中安装并设置了 pocketsphinx 和 sphinxbase 包。我还为 github 获取了语音识别代码,并根据要求更改了数据和模式目录,但是当我尝试通过“python test.py”运行它时仍然无法通过语音进行流式传输这里是代码:
#!/usr/bin/env python
import os
import sphinxbase as sb
import pocketsphinx as ps
MODELDIR = '/usr/lib/python2.7/site-packages/speech_recognition/pocketsphinx-data'
DATADIR='/usr/lib/python2.7/site-packages/speech_recognition/pocketsphinx-data'
# Create a decoder with certain model
config = ps.Decoder.default_config()
config.set_string('-hmm', "/usr/lib/python2.7/site-packages/speech_recognition/pocketsphinx-data/en-US/acoustic-model")
config.set_string('-lm', os.path.join(MODELDIR, 'en-US/language-model.lm.bin'))
config.set_string('-dict', os.path.join(MODELDIR, 'en-US/pronounciation-dictionary.dict'))
decoder = ps.Decoder(config)
# Decode streaming data.
decoder.start_utt()
stream = open(os.path.join(DATADIR, 'en-US/goforward.raw'), 'rb')
while True:
buf = stream.read(1024)
if buf:
decoder.process_raw(buf, False, False)
else:
break
decoder.end_utt()
stream.close()
print('Best hypothesis segments:', [seg.word for seg in decoder.seg()])
Run Code Online (Sandbox Code Playgroud)
请告诉我如何执行它。