I made a music info tracker that I shouldn't have needed to make

Lately, I've been improving the production quality of my live streams, by utilizing transparent video through VP9 for my overlays in OBS and using stinger transitions. However, there was still an element missing that I used to have in my streams way back in 2014 and 2015. That is the information of the currently playing song.

There's many different ways to accomplish this. If you search "now playing info obs" you get a lot of information, programs and scripts that people use to accomplish this. Most of these are compatible with Spotify, Last.fm, Soundcloud, VLC and many others. I don't use any of these players for my music listening though. I use iTunes on my Windows PC.

The first solutions

There are two programs that I have found that are compatible with iTunes, that can export the song information and album art to files for OBS to read. These are Snip and Snaz. Snaz removed this functionality in the latest version, but older versions were still available.

I used to have Snaz running in the background to track the music information and display it in OBS, but yesterday it broke up to the point that I required a full reinstall of iTunes. I don't understand why it broke my install so horribly, because I also run Rainmeter and that uses the same COM API to fetch this information and it never caused this weird behaviour.

So first of all, Snaz isn't actually open-source, despite being hosted on GitHub. The creator just shares his binaries and updates the README file. So there was no way for me to cross reference the code with the library being used by Rainmeter and see how the implementations differ. But I honestly couldn't really be bothered.

I just wanted my stream to work.

I then randomly found Snip on one of my drives and decided to run that.

And no dice.

The error that Snip keeps throwing when having iTunes selected.

So then I thought, what if I just made a rainmeter "widget" that exports the info to a file?

My Solution

When I first thought about this I thought I went crazy, but I did it anyway. I made a Now Playing tracker for OBS in Rainmeter. By using the data it gets from iTunes and passing it to PowerShell, so it writes to a file that OBS can read.

There's still a few edge cases that involves songs that have " and ' in them because the value just gets passed raw to powershell. Powershell handles text input/echos very weirdly imo. I also tried passing it through WSL but that wasn't really a universally viable solution.

So I just stuck to PowerShell instead!

Anyway is the repo if you want to get it right away: https://github.com/MiraiSubject/NowplayingToTextRainMeter

If you have any comments about this article or want to talk about it feel free to reach out to me on these channels:
Twitter: https://twitter.com/miraisubject
Twitch: https://twitch.tv/miraisubject
Discord: https://mirai.gg/discord

I also have a YouTube channel you should subscribe to if you're interested!
YouTube: https://youtube.com/mirai-s

Show Comments