提问者:小点点

C#-如何进行唯一的语音识别?


我有一个C#项目,我想将其添加到唯一语音识别功能中。 在这个项目中,我得有一个不同人的语音样本的数据库,并将传入的声音在参数方面与数据库中的声音进行比较,但我不知道如何从声音中提取这些参数? 我怎么比较它们呢? 我听说有可能使用机器学习主题来做到这一点,但我对它们还一无所知。 亲爱的朋友们,你能给我介绍一些这方面的资源或者教程吗? 或者如果你能指引我? 谢谢大家。。。。

到目前为止,我只能实现一个文本敏感的语音识别程序,但这还不够,因为它对特定的声音并不敏感:

public partial class EnVoiceUC : UserControl
{
    public EnVoiceUC()
    {
        InitializeComponent();
    }
    string[] dialogs = Program.dlgArr;
    private void Recorder_SpeechRecognized(object sender, SpeechRecognizedEventArgs e)
    {
        Form1 f1 = new Form1();
        string recText = e.Result.Text;
        for (int i = 0; i < dialogs.Length; i++)
        {
            if(dialogs[i]==recText)
            {
                try
                {
                    ((Form)this.TopLevelControl).Hide();
                    f1.ShowDialog();
                    ((Form)this.TopLevelControl).Close();
                } catch {;}
            }
        }
    }

    private void DoRecord_Click(object sender, EventArgs e)
    {
        System.Media.SystemSounds.Beep.Play();
        VoiceRecorder(true);
    }

    public void VoiceRecorder(bool enable)
    {
        Choices voices = new Choices();
        SpeechRecognitionEngine recorder = new SpeechRecognitionEngine();
        voices.Add(dialogs);
        Grammar gramer = new Grammar(new GrammarBuilder(voices));
        label2.Visible = enable;
        if (enable)
        {
            try
            {
                recorder.RequestRecognizerUpdate();
                recorder.LoadGrammar(gramer);
                recorder.SpeechRecognized += Recorder_SpeechRecognized;
                recorder.SetInputToDefaultAudioDevice();
                recorder.RecognizeAsync(RecognizeMode.Multiple);
            }
            catch { return; }
        }
        else
        {
            try { recorder.UnloadGrammar(gramer); } catch { return; }
        }
    }
}

共1个答案

匿名用户

也许你可以对每个声音样本做傅立叶分析。 你会发现每个人的声音都有一个独特的频谱。 如果是这种情况,你可以将这些频谱耦合到一个人,从而通过声音来识别这个人。