Day 95 – Speaker Voice Verification Using SpeechBrain
We saw posts in previous blogs about SpeechBrain, Features, PreTrained models, Multi-Speaker Speech Separation and Recognition Using SpeechBrain, and Speech Recognition On Different Languages By SpeechBrain.
Today, we are going to see in detail about Speaker Voice Verification?
What is Speaker Voice Verification?
Sometimes, we listen to audios and feel we are hearing same voice on both audios though it’s a different voice on audios. Speaker voice verification model verifies both speakers are same for the audio and returns True or False.
Let’s get into a code to check simple Speaker Voice Verification.
I have used SpeechBrain Pretrained models and audio files and downloaded mixed audio files (Audacity) from Azure Github.
To check my full code in Google Colab as well as here.
#Install Torchaudio, SpeechBrain and Transformers
!pip install torchaudio==0.8.1 #Temporary (until pytorch 0.9 is supported in Colab)
!pip install speechbrain
!pip install transformers
#Import all libraries
import speechbrain as sb
from speechbrain.dataio.dataio import read_audio
from IPython.display import Audio
#Download pretrained SpeakerRecognition from SpeechBrain
from speechbrain.pretrained import SpeakerRecognition
verification = SpeakerRecognition.from_hparams(source="speechbrain/spkrec-ecapa-voxceleb", savedir="pretrained_models/spkrec-ecapa-voxceleb")
score, prediction = verification.verify_files("speechbrain/spkrec-ecapa-voxceleb/sampledata_samevoice1.wav", "speechbrain/spkrec-ecapa-voxceleb/sampledata_samevoice2.wav")
print(prediction, score)
CTO at Aurum Window Cleaning & Property Care - A Gold Standard Company
1yI do not understand AT ALL why the speech recognition requires a pre-trained model, namely, this line "source="speechbrain/spkrec-ecapa-voxceleb" Do you ?? I mean, why comparing 2 voice samples and figuring out whether they are the same requires pre-trained neural network that is pre-trained on completely different samples ?