Mapped genres across languages with search voice

by Salvador Morales León

Version 1 (July 21, 2024)

Download (10 downloads)

This is pretty straightforward. I use this to map the genres, styles, artists... That the speech recognition is unable to recognize because I am Spanish and I have the speech recognition in English. You know? When you say some word, but because you don't have the pronunciation, it end up being another word.

"THE REASON BEHIND IT"

I did this flow because the speech recognition is not very accurate when recognizing other languages.

For instance, instead of Jazz Avant-Garde, it may recognize literally "jazz avangard".

Since on my library I have the style of Jazz as the first word, I needed some way of making speech recognition understand that I was saying Jazz Avant-Garde and not the other word.

Or maybe I wasn't saying Bjork instead of Björk. You know now what is the reason behind this.

"WHAT IT DOES"

Basically, you can speak a word, continuing with the genres thing. Let's say you want to listen to some Coladeira. You say that word after starting the flow. Since the table on the database is empty, it will prompt a dialog so you can enter the right word. The wrong recognized word, on this case "volade", will be added to the same row on the table.

Finally you need to add a class name. Classes here are useful to tell the flow what are you trying to say exactly. So the query will automatically look up for a style, language, genre, album, artist...

"A PRACTICAL EXAMPLE"

For instance, in the case of Coladeira. The table will look like this.

Corrected genre
Coladeira
Wrong_recognized_word
Volade
Class
Style

"EACH TIME YOU SAY A WORD"

Next time you use that style or genre, depending on your preference or how you catalog your music, it could happen two things.

1) the word that the speech recognition recognizes is volade. In that case the query will look for styles that are LIKE coladeira. As it will look on the table where I have my music information stored for style (class) and coladeira [wrong recognized as volade] (style). On my case, it will start playing that style.

2) if the word the speech recognition recognizes is another one—such as another genre or artist—even if you say the same word, Coladeira for example, the process of input dialog choices will show again.


"NOT ONLY FOR MUSIC PURPOSES"

I must say that you can use this for anything, you don't need to use it only for music. I use it because I have my library stored on a table and I use MySQL to do queries like:

SELECT path FROM AwesomeLibraryPruebafull WHERE style LIKE "psicodélico rock" or whatever placeholder I use.

Then I pass the path to a play sound block. In a nutshell, I use it as a music player.

"FINAL NOTE"

In order to try it you will be creating a folder called Automate Projects with a database.

You will know that it is working because it will show a toast with the right genre and the class. Unless it is the first time you use it or the first time you enter a new word. Since there is not anything stored on the database it will show null.

Enjoy this tutorial!!!