I have almost no programming experience on Ubuntu but am looking for a way for my Arduino to tell my Ubuntu laptop to play a song. I think the easiest way would be to plug my Arduino into my laptop using the usb port and send a serial message from the Arduino saying something like "play song 1" then decode that in Ubuntu and play the song.
I'm okay on the Arduino side but not sure how to go about writing such a program on Ubuntu.
on the ubuntu side you will probably want to use python, here is a link to show how to communicate over serial Arduino Playground - Python. Then depending on the music player you are using you will need to figure out the commands to tell it to play a song. If you stick with the default for 11.10 it will be banshee, you can control next, stop, play...but not select a track. If you want a little more control I usually use moc as my media player. After you get the command over serial you can execute it in python using the subprocess module subprocess — Subprocess management — Python 3.11.3 documentation.