处理语音而不停止在MATLAB中的录制 [英] Process speech without stopping the recording in MATLAB

查看:95
本文介绍了处理语音而不停止在MATLAB中的录制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前正在同时处理语音信号.更具体地说:

I am currently processing speech signals while recording simultaneously. More specifically:

  1. 每隔0.1s语音重复记录一次.

  1. Record every 0.1s speech repeatedly.

以FIFO的意义处理每个语音数据包(例如,将此称为 功能process).处理一个数据包大约需要1秒 语音长度为0.1s.

Process each speech packet in a FIFO sense (e.g., call this function process). It takes about 1s for processing a packet of speech of length 0.1s.

以下是执行的代码:

r = audiorecorder(fs, 16,1);
data{k} = getaudiodata(r);
process(data{k});

问题是执行process时我错过了1s语音的样本.我希望录制不间断地执行,并在每0.1s语音录制中调用函数process.我尝试使用为audiorecorder.提供的函数回调.问题是TimerFcn是在记录过程中重复执行的函数,在记录过程中无法检索样本.

The problem is that I miss sample of 1s speech during process execution. I want the recording to be executed without stop, and call the function process in every 0.1s speech recording. I try to use function callback provided for audiorecorder. The problem is that TimerFcn, which is the function to be executed repeatedly during recording, cannot retrieve the sample during recording.

有什么建议吗?

推荐答案

尝试在使用getaudiodata()

必须根据时间进行一些安排. (由于plot()绘制了声音信号在时间轴上的位置,因此应该根据时间分配一些值)

That must have some arrangement depending on time. (It should have some distribution of values according to time because plot() plots the sound signal wrt time axis)

根据该安排遍历矩阵,然后调用process()函数.

Iterate through the matrix according to that arrangement and call the process() function.

通过这种方式,您可以一次录制声音,然后通过迭代每隔0.1秒一次处理.

This way you can record the sound at once and then process for every 0.1 secs one by one by iterating.

这篇关于处理语音而不停止在MATLAB中的录制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆