Top 5 This Week

Related Posts

I built a karaoke machine using a Raspberry Pi: Here’s how you can too

Karaoke is my jam, and I know a few friends who feel the same way. But here’s the catch: we don’t always want to leave the house to sing our hearts out. Imagine having a karaoke machine right at home! It would be an absolute blast, bringing endless fun and entertainment to everyone, from solo singers to families and friends. With a karaoke machine, you can sing your heart out without worrying about scheduling or location. It’s like having your own personal karaoke party anytime, anywhere!

Related


10 Raspberry Pi projects you can complete in less than an hour

There’s a lot you can do with a Raspberry Pi, including these projects that should take less than an hour from start to finish

While you might think this means shelling out money for equipment you may not use often, that’s not the case. I built a karaoke machine that plugs into my TV using a Raspberry Pi, and you can, too. Let’s get started.

A render of the Raspberry Pi 5

What you need to build your own Raspberry Pi karaoke machine

We’re going to use Pikaraoke, an open-source KTV-style karaoke song search and queueing system. It connects to your TV and displays a QR code that you and others can scan with a smartphone or tablet to access the software. Once set up, the web interface lets you search the local track library and download new karaoke tracks from YouTube and other sources.

To complete this project, you’ll need a few things. Of course, if you’re already in the Raspberry Pi world, you might already have everything you need. To break it down, here’s what will be required (in addition to a monitor or TV on which to view the songs, of course).

Equipment

Notes

Raspberry Pi

You can use a Pi as old as the Raspberry Pi 3, but performance might not be the greatest. You should also have the latest version of Raspberry Pi desktop OS.

Compatible HDMI cable

No need for anything fancy; a basic HDMI cable will work fine.

Compatible power supply for your Pi

For the Raspberry Pi 5 especially, make sure it provides enough power for the Pi to perform at its best.

USB keyboard and mouse

You’ll need these to install and configure the Pi, then to launch the karaoke software.

Storage device

A micro SD card will work, but you may need external storage for the song downloads. I used a 1TB NVMe SSD with my Raspberry Pi 5.

A computer capable of writing the OS image to your micro SD card

The Raspberry Pi imager is available for Windows, Mac, and Linux, so plenty of options here.

SD Card reader

You’ll also need a micro SD to SD card adapter.

Image writing software

Raspberry Pi Imager or balenaEtcher would work fine.

Internet connection

This is necessary to download and install the software and karaoke tracks, as well as for you and your fellow singers to sign up to sing.

Once you’ve installed Raspberry Pi OS, you’re ready for the next step.

Setting up Pikaraoke on your Raspberry Pi

Install the necessary packages

You’ll need to install a few packages on your Pi if they aren’t already there. From a terminal window, use these commands to install ffmpeg, Chromium browser, and Chromium ChromeDriver.

sudo apt-get install ffmpeg -y

sudo apt-get install chromium-browser -y

sudo apt-get install chromium-chromedriver -y

The ffmpeg package is used to convert and stream audio and video. Pikaraoke uses the chromium-chromedriver package to send commands to Chromium on the Raspberry Pi and drive the web interface on your smartphone, tablet, or computer.

Install Pikaraoke in a Python virtual environment

Next, you’ll install Pikaraoke itself. Although it is available on GitHub, the easiest way to get it going is by using Python. To avoid conflicts and other hassles, you should create a virtual environment in Python.

First, open a terminal window or use the one from the previous section. Using the following commands, create the directory for your virtual environment, then activate it.

python -m venv ~/.venv

source ~/.venv/bin/activate

Next, install Pikaraoke in the virtual environment.

pip install pikaraoke

After a few moments, the software will be ready to launch. From your virtual environment, type the command:

pikaraoke

Pikaraoke should start in headed mode, displaying the splash screen in a full-screen Chrome window on your TV. Next, you can connect to the server from your phone or other device capable of scanning a QR code.

If you close the virtual environment, you’ll need to activate it again before launching Pikaraoke.

Getting your Pikaraoke jam on

Once Pikaraoke is up and running, you’ll see a QR code in the bottom left corner of your TV. You can use your device’s camera app or QR code reader to scan the code and connect to the Pikaraoke web interface. Once connected, you can search for and add songs to the queue.

The web interface is clean and straightforward, with several icons to access different parts of your karaoke experience. Tap the numbered list icon to view the queue of upcoming songs. The magnifying glass allows you to search for songs, and the file folder icon shows the songs already downloaded to Pikaraoke.

When you click the search button for the first time, Pikaraoke will ask for your name. The server displays this in the queue, the “Up next” banner, and the now-playing sections. That way, your family and friends know who’s up next with what song. Of course, you’ll also see this information on the home page of the web interface on your phone.

After some songs have been added to the queue, it’s time to start singing. You can change the order of the songs, delete upcoming tracks, or add random songs from the local library on the Queue tab. You can also add songs from the local library tab.

Fine-tuning your karaoke experience

Pikaraoke offers a full-featured karaoke experience with many of the same features professional KJs offer. For example, you can change the song’s key by moving the slider beneath the Change Key label.

PiKaraoke Change Key

Slide to the left to lower the key by a certain number of semitones. If you want to raise the key for a higher pitch, move the slider to the right. After Pikaraoke transposes your song using the chosen number of semitones, the server restarts the song. That way, you can start in the key you prefer to sing it in.

Closing time: You don’t have to go home…oh wait, maybe you’re already there

Time to wrap up the party? From either one of the phones or tablets connected to the Pikaraoke server, choose the hamburger menu (three horizontal lines) in the top right corner. Tap the white i Pikaraoke button, scroll down, and tap Quit Pikaraoke.

To access this menu from the Pikaraoke machine, move the mouse to the top left corner and choose the hamburger menu, which will bring up the familiar menu you see on your smartphone. Click the hamburger button in the top right corner of that menu, then follow the instructions above to shut down Pikaraoke.

Next time: Booting Pikaraoke automatically

Of course, this setup doesn’t launch Pikaraoke when you power on your Raspberry Pi. You’ll have to connect a keyboard and mouse to launch the karaoke server or use Raspberry Pi Connect from another computer. You can, however, create a script that launches Pikaraoke upon boot.

First, create an autostart launcher using these commands from the terminal on your Raspberry Pi.

mkdir ~/.config/autostart

touch ~/.config/autostart/pikaraoke.desktop

Next, create a wrapper script to launch your virtual environment and Pikaraoke. This is necessary because launching the virtual environment and Pikaraoke with a single Exec command is impossible.

touch ~/launch-pikaraoke-venv.sh

chmod +x ~/launch-pikaraoke-venv.sh

Once the wrapper script is created, edit it using this command:

nano ~/launch-pikaraoke-venv.sh

Add the following commands to the wrapper script, save it, and exit nano.

#!/bin/sh

source /home/pi/.venv/bin/activate

pikaraoke

Finally, edit ~/.config/autostart/pikaraoke.desktop to include these settings:

[Desktop Entry]

Type=Application

Name=Pikaraoke

Exec=/home/pi/launch-pikaraoke-venv.sh

Once done, reboot your Raspberry Pi. Pikaraoke should automatically launch after the Pi boots.

Going more pro: Improving the sound setup

Pikaraoke sends audio over your Pi’s HDMI cable, and you’ll notice I haven’t mentioned microphones at all. This is because the Raspberry Pi doesn’t have an audio input jack to plug a mic into, and USB mics tend to have too much latency to work well.

If you want to add microphones to your karaoke setup, using an analog mixer alongside your Raspberry Pi is the best option. The mixer will route your Pi and microphone audio to an amplifier and speakers. Some USB mixers, such as Behringer’s X-Air and Xenyx series, work over USB, allowing you to adjust your mix straight from the Pi.

Another example of the versatility of the Raspberry Pi

This is just one more type of entertainment use of your Raspberry Pi. You probably already knew you could use it as a streaming media server, but this project shows it can do much more. The total setup for the project is quick, making Pikaraoke one more example of a Raspberry Pi project you can complete in less than an hour.

#built #karaoke #machine #Raspberry #Heres

source: https://www.xda-developers.com/build-karaoke-machine-raspberry-pi/

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Popular Articles