Closed darrenelmslie closed 8 years ago
Just a wild guess – does exec() know how to interpret the ~ ?
Thanks for the quick response Mike. I wondered that after I posted, so tried substituting the full path but no luck.
I've also tried a fifo-js javascript package reads the shairport-sync-metadata file if I echo into it manually without shairport running. As soon as I'm running the service, nothing.
I tried changing tack and edited the shairport-sync-metadata.c file - I needed to filter which metadata was reported anyway. While I was in their I tried adding a fprintf command to output certain metadata fields to a 'NowPlaying.txt';
// printf("Got it decoded. Length of decoded string is %u bytes.\n",outputlength);
payload[outputlength]=0;
FILE *fp; fp=fopen("/home/pi/NowPlaying.txt", "w"); if (fp == NULL) { printf("Error opening NowPlaying!\n"); exit(1); }
// this has more information about tags, which might be relevant:
// https://code.google.com/p/ytrack/wiki/DMAP
switch (code) {
// case 'asal':
// printf("Album Name: \"%s\".\n",payload);
// break;
case 'asar':
fprintf(fp, "Artist: \"%s\".\n",payload); fflush(fp); fclose(fp);
printf("Artist: \"%s\".\n",payload);
break;
But I'm not seeing anything in the NowPlaying file either :(
sorted it - I needed to perform my fopen with append, rather than write :)
Thanks – I wouldn't have figured that out...
Hey Darren, would you mind sharing your work on this? Looking to do exactly the same!
@NickSutton - You can try using https://github.com/roblan/shairport-sync-reader It's still work in progress, but should work ;)
less of an issue, more of a question. I'm very new to coding but desperately trying to incorporate Shairport Metadata reader into a MagicMirror module.
I'm trying to call the compiled code (which runs great on it's own!), using a child process from javascript:
The javascript is running without error but I'm getting nothing back at all in the console. Have I made any obvious mistakes?
Thanks for any assistance you can give