I found a question that could help you: How to start a background timer in a Windows 8 phone?
when you set a timer that checks every x seconds, if the "name" is different from the last known name, then you can send this information back.
This could be a timer code:
Declare the following:
string _newValue = string.Empty; string _currentValue = string.Empty; AudioTrack _tempTrack = null;
and set this as tick for timer
if (this.BackgroundAudioPlayer != null) { if (this.BackgroundAudioPlayer.Instance != null) { if (this.BackgroundAudioPlayer.Instance.Track != null) { this._newValue= yourAPI.GetTitleOfTrack(); try { this._tempTrack = this.BackgroundAudioPlayer.Instance.Track; if (this._tempTrack != null) { if (this._tempTrack.Tag != null) { this._currentValue = this._tempTrack.Tag.ToString(); } else { this._currentValue = string.Empty; } if (this._currentValue != this._newValue) { this.BackgroundAudioPlayer.Instance.Track.Tag = this._newValue; } } } catch(Exception ex) { } } } }
Remember: change "yourAPI.GetTitleOfTrack ()" - this is a function by actually calling your API function.
source share