ShairportSync.TrackInfoReader is a shairport-sync metadata parser which provides track information (artist, album, song title, artwork image, etc.) as Rx (IObservable<TrackInfo>
).
This library works on .NET Standard 2.0 compliant platforms like .NET Core 2 / Mono.
i.e. works on Raspberry Pi 2 / 3, Mac, Linux, etc.
Contains two usage example apps below.
Package Manager:
PM> Install-Package ShairportSync.TrackInfoReader
.NET CLI:
dotnet add package ShairportSync.TrackInfoReader
var trackInfoSource = TrackInfoReader.GetObservable("/tmp/shairport-sync-metadata");
trackInfoSource.Subscribe(t => Console.WriteLine($"{t.Artist} {t.Album} {t.Song}"));
On your Pi, download, unzip and set permission as follows.
(No need to install .NET Core.)
curl -s https://api.github.com/repos/idubnori/shairport-sync-trackinfo-reader/releases/latest \
| grep "examples-linux-arm.zip" \
| cut -d '"' -f 4 \
| wget -qi -
unzip examples-linux-arm.zip
chmod +x ./console-viewer/ConsoleViewer ./web-viewer/WebViewer
Run shairport-sync with metadata pipe parameter.
shairport-sync --pipe=/tmp/shairport-sync-metadata
./ConsoleViewer /tmp/shairport-sync-metadata
./WebViewer pipe=/tmp/shairport-sync-metadata
Browse http://<Pi HostName>:5000/
Install NET Core 2.2 SDK.
Open TrackInfoReader.sln
. And Build it.
# Move to solution root directory.
dotnet build
# Move to ConsoleViewer or WebViewer directory.
dotnet publish -c Release -r linux-arm
# Deploy ./bin/Release/netcoreapp2.0/linux-arm/publish/ to Pi.
ShairportSync.TrackInfoReader is Copyright © 2019 idubnori under the MIT License.
build.cake
is based on EventFlow