Now that the FM transmitter is working, we can make it do something a little more useful; in this case, we will use it to broadcast a personalized radio station with a collection of your own music.
To do this, we will write a Python script that manages to search for MP3 files and calls PiFM to broadcast them.
In the PiFM download and on the PiFM website, you may have noticed that there is a Python library that can be used to control PiFM. Although, looking at the source code for it, you can see that all the library can do is call the
pifm executable with the minimum number of commands, and therefore will not allow us to play MP3 files.
However, it is a simple process to create our own function that ...