Using the npm package "icecast," I have been able to decode the stream metadata with the following code:
// Get Alexa to name the song currently playing 'NowPlaying': function nowPlaying() { // Get the Artist and Title of the song Now Playing // connect to the remote stream icecast.get('http://prod-65-19-131-160.wostreaming.net/brewerchattanooga-wplzfmmp3-64', function (res) { // log the HTTP response headers console.error(res.headers); // log any "metadata" events that happen res.on('metadata', function (metadata) { var parsed = icecast.parse(metadata); // Log the Artist and Title to Global Variable StreamTitle = (parsed.StreamTitle); console.error(StreamTitle); }); }); // return Alexa response this.response.speak(this.t('NOWPLAYING_MSG')); this.emit(':responseReady'); },
The above code correctly logs the Artist - Title string (StreamTitle) value to Cloudwatch. However, it seems that the StreamTitle variable is locked deep within the nested functions. I've attempted setting a Global Variable outside the functions then updating that value as seen above without declaring a local variable within the function with no success; resulting in Alexa being unable to read back the StreamTitle.
Any suggestions are most appreciated.