I currently making simple music player and would like to stream online radio. I managed to stream ShoutCast radio but the problem is I have no idea how to parse the title and artist from streaming metadata. Here is my code.
Player.cs
public string[] GetTags(bool streaming)
{
if (streaming == true)
{
IntPtr tag = Bass.BASS_ChannelGetTags(stream, BASSTag.BASS_TAG_META);
string[] tags = Utils.IntPtrToArrayNullTermUtf8(tag);
if (tags != null)
{
return tags;
}
}
return null;
}
Main.cs
private void btnLoadURL_Click(object sender, EventArgs e)
{
p.LoadURL(tbFile.Text);
string[] tags = p.GetTags(true);
if (tags != null)
{
foreach (String tag in tags)
{
lblStatus.Text = tag;
}
}
}
Currently I need to iterate through the tags
to get the metadata in the format StreamTitle='xxx';StreamUrl='xxx';
. I would like to parse this into;
Title: xxx
Artist: xxx
and remove StreamUrl
entirely.
Thanks!