Skip to content
This repository has been archived by the owner on Oct 8, 2023. It is now read-only.

Latest commit

 

History

History
244 lines (151 loc) · 6.21 KB

README.old.md

File metadata and controls

244 lines (151 loc) · 6.21 KB

VoiceNET Library

Nuget NuGet

Free Voice Command Control Library

Introduce

VoiceNET Library makes it easy and fast to create Voice Command Control functionality through Label Prediction. It helps develop software or web voice control in real-time. It free supports online and offline use. This is a community development project to help people access voice recognition technology more easily.

It's a research project from the FPT Edu Research Festival 2021 contest.

VoiceNET Library

How its work?

Using ML.NET and Spectrogram libraries, the VoiceNET library works by converting your voice into a spectrogram. From there, proceed to use the Image Classification function in the ML.NET library to mark the label.

How the VoiceNET Library works

Features

  • Voice Command Control in real time.
  • Voice Command Control based on recording.

Advantage

  • Easily integrate the library into your program.
  • The code has been simple for every to use.
  • It can be used both online and offline.
  • It can be used for any communication language in the world.
  • It's free.

Disadvantage

  • It takes a long time to create a Model for the library
  • The time it takes to load the model into the program can be slow.
  • There's still an error rate when labeling recognition.

Installation

Once you have an app, you can install the VoiceNET Library NuGet package from the .NET Core CLI using:

dotnet add package VoiceNET.Library

or from the NuGet Package Manager:

Install-Package VoiceNET.Library

Quickstart

WinForm Real-time (This is full customization functionality, can use QuickStart in version 1.0.5.2)

Example

A real-time voice-controlled image gallery

How to make a demo in real-time?

Drag and drop into the Windows Forms interface:

  • Picturebox: pbSpectrogram and picTake with Width=400
  • Combobox: cbDevice
  • Label: lbResult
  • Timer: tmLisener (Interval 100, Enabled=True) and tmDisposeRam (Interval 1, Enabled=True)

In Form_Load

 VBuilder.getDevice(cbDevice);
 
 VBuilder.setVolume(80);
 
 VBuilder.ModelPath("<your_model_path>");
 
 if(VBuilder.loadModel())
 
    //do something after Load Model
	
 else
 
   //do something if fail
   

cbDevice_SelectedIndexChanged

StartListening();

Create two private void: StartListening() and DisposeImage().

StartListening()

DisposeImage();

VBuilder.StartListening( cbDevice );

DisposeImage()

pbSpectrogram.Image?.Dispose();

pbSpectrogram.Image = null;

tmDisposeRam_Tick

DisposeImage();

pbSpectrogram.Image = VBuilder.ListenTimer(pbSpectrogram.Width);

tmLisener_Tick

  if(VBuilder.requestDisposeListening)
  
            {
			
                picTake.Image = VBuilder.getImageTaken(pbSpectrogram);

                lbResult.Text = VBuilder.Result();

                StartListening(); //Renew Lisener

                VBuilder.requestDisposeListening = false;
				
            }
			
			else
			
            {
			
                VBuilder.reduceNoiseAndCapture(pbSpectrogram);
				
            }

WinForm Recording

Example

Example of command label recognition by recording

How to make a demo in recording?

Drag and drop into the Windows Forms interface:

  • Button: btnRecord, btnStop
  • Label: lbResult

Form_Load

VBuilder.ModelPath("<your_model_path>");

 if(VBuilder.loadModel())
 
    //do something after Load Model
	
 else
 
   //do something if fail
   

btnRecord_Click

VBuilder.StartRecord();

btnStop.Enabled = true;

btnRecord.Enabled = false;

btnStop

VBuilder.StopRecord();

lbResult.Text = VBuilder.Result(true);

btnRecord.Enabled = true;

btnStop.Enabled = false;

WPF Real-time - Support from v1.0.5

See the example in VoiceNET.Lib.WPF.Realtime for more how to use it.

WPF Recording - Support from v1.0.5

See the example in VoiceNET.Lib.WPF.Record for more how to use it.

Web ASP.NET MVC - Support from v1.0.2.4

See the example in VoiceNET.Lib.Web.AspNet for more how to use it.

How to create a Model?

Use the included MicBuilder program to build an MLModel.zip file for your Dataset.

MicBuilder Model Builder

Resources

LICENSE

MIT LICENSE

  • Spectrogram - is a .NET library for creating spectrograms from pre-recorded signals or live audio from the sound card.
  • ML.NET - is a cross-platform open-source machine learning (ML) framework for .NET.
  • VoiceNET Library - is a .NET Library makes it easy and fast to create Voice Command Control functionality.