Friday, August 28, 2026

Finding MP3 streams for internet radio part 2

For an index to all my stories click this text

When building an internet radio you will need to know the URL's of the MP3 streams of the radio stations. Last week I showed a method to find these streams with VTuner. There is however a far more easy method.

Method 1: fmstream.org

fmstream.org is a website that lists thousands of internet radio stations.
You can find the site here: https://fmstream.org/index.php?c=FT

On opening the website you can search stations by country, language or music style. But there is also a search function in which you can type the name of the station you are looking for.


I searched for NPO Radio as that is the name of all the Dutch public radio stations (NPO Radio 1, NPO Radio 2 ..... NPO Radio 5).

Next to the name of the station there are small squares that tell you what format the station can stream.


I am looking for MP3 so I clicked on the square mp3 96


At the bottom of the page there is an audio player.
And look carefully at that.


There is the link you need.

https://icecast.omroep.nl/radio1-sb-mp3

That's all. This is the link you need for building your internet radio.

Method 2: radio-browser

radio-browser is another side that lists thousands of internet radio stations.
You can find it here: https://www.radio-browser.info/


This site also gives the opportunity to search stations by country, language, tag or codec.

At the top-right side of the site there is a general search function.
So I searched for NPO Radio.


And almost immediately I got a list of the Dutch public internet radio stations.


Here are the details of NPO Radio 1.

Pressing the play button opens an audio player at the bottom of your screen and the station starts playing. But that was not what I was looking for.

Pressing the MP3 button got me the information I was looking for.


And there is the link I was looking for.

http://icecast.omroep.nl/radio1-bb-mp3

Concluding

Both fmstream.org and radio-browser are great sites to search for MP3 streams from radio stations. Both offer a search on country or music style, and a general search for a stations name.
Both sites immediately give you the URL needed for building an internet radio.

This is a lot easier then distilling the info from the VTuner's page sourcecode.

That's it for now.
Till next time
Have fun

Luc Volders

Friday, August 21, 2026

Finding MP3 streams for internet radio part 1

For an index to all my stories click this text

Time really flies !! I could not believe my eyes when I saw that my stories on building an internet radio dated from 2018 !!! At that time I build an internet radio with a Raspberry Pi Zero. It was a 4 part story.

You can read the stories that start with what hard and software you need and building a single station internet radio, to a headless (no display or keyboard) stand alone internet radio, with only some buttons that allow to choose the desired radio stations. I'll give you the link to the last part in which you can find links to the previous parts:
https://lucstechblog.blogspot.com/2018/10/raspberry-pi-internet-radio-part-3.html

Well this suddenly became current again.
Like a lot of people we have TV, internet and (landline) telephone from one company. My girlfriend enjoys listening to a certain classic radio station using our stereo set. However that radio station suddenly decided that it would only broadcast through the internet instead of the cable. And our stereo set does not have internet radio on board.

So time to build an internet radio for our living room.

There was only a slight problem. In part 2B in the series I described how you easily can find the URL's for the MP3 streams with VTuner. And that did not work anymore. Well things change in 7 year ..........

The new VTuner method.


First step is to point your browser to http://www.vtuner.com/

 At the top-right side of the page click on "Check out our huge station list!"


So far so good.

I was looking especially for a station with the name Classic FM, and (like said above) it is an internet only station. So I filled that name in, in the search box. Obviously you may want to look for another radio station. To get that stream just follow the steps I'll show you here.


And I got a complete list of radio stations with the name Classic FM.
There was one with the indication Internet Only and that was the one I needed.


Press the green play button in front of the station name.


A new screen opens with an audio player at the bottom.


Press the play button.
The player plays the realtime radio stream from that station.

My web browser is Firefox and I do not use Windows but my computer runs Linux (Kubuntu). So the next steps might be different on your system. But they are not difficult to follow.

Search in your browser menu for the option to look at the page source. In Firefox it is in the Hamburger menu on at the top-right side of the browser screen under the More tools option. You can also find it by pressing the right-side mouse button.


Use the search function in your browser to look for "MP3"
And there it is.

http://classicfm.ice.infomaniak.ch/classic-fm.mp3

Select only this part and you got the link you need for your internet radio !!!

This is all a bit tedious. Fortunately I found an easier method to get the link. That's for next weeks story.

Till then,
have fun

Luc Volders

Friday, August 14, 2026

Javascript Speech Recognition

For an index to all my stories click this text

Speech synthesises is having your computer speak out words and sentences to you. You can do that with Javascript like I wrote in this story: 
https://lucstechblog.blogspot.com/2025/09/javascript-speech-synthesises.html
But even microcontrollers like the ESP32 can (although in a very low quality) speak out words and sentences like you can read in these stories:
- talkie 1
https://lucstechblog.blogspot.com/2022/11/talkie-part-1-esp32-speech-synthesiser.html 

- Audio on the Raspberry Pi Pico part 4
http://lucstechblog.blogspot.com/2024/11/pico-audio-part-4-talking-thermometer.html

But next to that there is speech recognition. That's the other way round. You speak into a microphone and your computer recognizes the words and acts on them. The most famous examples are of course Google Home and Alexa.

A few years ago I wrote a story on how to build a speech recognition App for Android:
https://lucstechblog.blogspot.com/2016/01/voice-command.html

This time I am going to show you how it is done in Javascript.
There is a limitation and that is that this is Windows only and it does not work in Firefox. Firefox does not support speech recognition. So you will have to use Google Chrome or Microsoft Edge.

Javascript.

Javascript runs in a browser. So to use it you need to build a minimal web-page.

On this web-page we put a text that tells what this page is about and an empty paragraph into which the spoken and recognized words and sentences are put.

<!DOCTYPE html>
<html>
<body>
<h1 style="color:red;">Luc's speech recognition</h1>
<h2>Below comes the text that you speak.</h2>
<br>
<p id="texthere"></p>

</html>

This is the complete web-page. However it does nothing exept setting some text on your screen. To have speech recognition to work we need a Javascript program. and here is that program line by line.

window.SpeechRecognition = window.webkitSpeechRecognition || window.SpeechRecognition;

This line selects the speech recognition that is needed for your browser.

const recognition = new window.SpeechRecognition();

We make an instance of the Speech.Recognition and call it recognition

    recognition.continuous = true;


This line is important as it sets the speech recognition to continuous.
Continuous means that you do not need a button to click on each time you want a new sentence to get analysed.

    recognition.lang = "en-US"

And with this line you can change the language you want to get recognised.

    recognition.onresult = (event) =>
    {
      var textheard = (event.results[event.results.length -1][0].transcript);
      document.getElementById("texthere").innerHTML = textheard;
    }


If the speech recognition has heard a sentence an event is raised.
The variable textheard gets the interpreted text from the speech recognition and that variable is put into the paragraph on the screen with the ID texthere.

recognition.start();


And this is the actual command that starts the speech recognition.

And that is all that is to it.

So here is the complete page with the Javascript code.

<!DOCTYPE html>
<html>
<body>
<h1 style="color:red;">Luc's speech recognition</h1>
<h2>Below comes the text that you speak.</h2>
<br>
<p id="texthere"></p>

<script>

window.SpeechRecognition = window.webkitSpeechRecognition || window.SpeechRecognition;

    const recognition = new window.SpeechRecognition();

    recognition.continuous = true;
    recognition.lang = "en-US"

    recognition.onresult = (event) =>
    {
      var textheard = (event.results[event.results.length -1][0].transcript);
      document.getElementById("texthere").innerHTML = textheard;
    }
    
    recognition.start();

</script>
</html>


Play with it.

To play with this, copy the above code and paste it into your favorite texteditor. I mostly use notepad for these small programs.
Save the file as recognition.html or any name you like in any folder of your choice. Just make sure it is plain ASCII and the file has the extension HTML.
Open the folder and you will see an HTML file. Left click on that and open it with Google Chrome or microsofts Edge.



The webpage asks now whether it is ok to use your computers microphone.
Then just speak any text to your liking.



And this is how the webpage looks after I said "put lamp number one on"
You can see where this is going.

Language selection.

The above program uses recognition.lang = "en-US" yo set the speech.recognition to recognise the English language. So here is a list of the other languages that are available.

Javascript uses the BCP 47 Language Codes and here is the complete list of languages that are available:

ar-SA Arabic Saudi Arabia
cs-CZ Czech Czech Republic
da-DK Danish Denmark
de-DE German Germany
el-GR Modern Greek Greece
en-AU English Australia
en-GB English United Kingdom
en-IE English Ireland
en-US English United States
en-ZA English South Africa
es-ES Spanish Spain
es-MX Spanish Mexico
fi-FI Finnish Finland
fr-CA French Canada
fr-FR French France
he-IL Hebrew Israel
hi-IN Hindi India
hu-HU Hungarian Hungary
id-ID Indonesian Indonesia
it-IT Italian Italy
ja-JP Japanese Japan
ko-KR Korean Republic of Korea
nl-BE Dutch Belgium
nl-NL Dutch Netherlands
no-NO Norwegian Norway
pl-PL Polish Poland
pt-BR Portuguese Brazil
pt-PT Portuguese Portugal
ro-RO Romanian Romania
ru-RU Russian Russian Federation
sk-SK Slovak Slovakia
sv-SE Swedish Sweden
th-TH Thai Thailand
tr-TR Turkish Turkey
zh-CN Chinese China
zh-HK Chinese Hong Kong
zh-TW Chinese Taiwan


So just change recognition.lang = "en-US" into recognition.lang = "nl-NL" to change from English to Dutch for example.

Some considerations.

First:
The speech recognition is continuous. However when there is a silence for more then 10 seconds the speech recognition is turned off and you will have to restart it manually.

Second:
Do not use this if you hate Google. Actually every sentence you speak is send over the internet to Google's speech recognition server in the cloud. So if you thought you could use this to get rid of your Google Home or Nest you are wrong. This is still using Google's services.

What's next

The next step is to combine the speech synthezises and the ESP webserver with the speech recognition. Then we will be able to have the ESP8266 react on commands like "put the lamp on" and "tell me the room temperature" !!!

Till then.
Have fun

Luc Volders