Quantcast
Channel: VBForums
Viewing all articles
Browse latest Browse all 15458

BASS_ChannelGetTags and BASS_ChannelSetSync

$
0
0
Decided to get away from WMP for my Icecast player and have tried working with Bass.dll and Bass.Net

So far I am able to get the stream to play but no I am having issues trying to read the metadata from the stream.

BASS_ChannelGetTags (to get stream info and titles) and BASS_ChannelSetSync (for title updates)

I honestly have no idea where to go from here.

It states to pull Tags use:

Code:

Dim tags As String() = Bass.BASS_ChannelGetTagsICY(stream)
If tags Is Nothing Then
  ' try http...
  tags = Bass.BASS_ChannelGetTagsHTTP(stream)
End If
If Not (tags Is Nothing) Then
  Dim tag As String
  For Each tag In tags
    (honestly not sure what goes here to show Title and Artist)
  Next tag
End If

And this to reload once new song starts playing
Code:

Private _mySync As SYNCPROC

Dim stream As Integer =  Bass.BASS_StreamCreateURL(url, 0, BASSFlag.BASS_DEFAULT, Nothing, 0)
' set a sync to get notified on stream title updates
_mySync = New SYNCPROC(AddressOf MetaSync)
Bass.BASS_ChannelSetSync(stream, BASSSync.BASS_SYNC_META, 0, _mySync, IntPtr.Zero)
Bass.BASS_ChannelPlay(stream, False)

Private Sub MetaSync(ByVal handle As Integer, ByVal channel As Integer,
                    ByVal data As Integer, ByVal user As IntPtr)
  ' BASS_SYNC_META is triggered
  Dim tags() As String = Bass.BASS_ChannelGetTagsMETA(channel)
  Dim tag As String
  For Each tag In tags
    (honestly not sure what goes here to show Title and Artist)
End Sub

Trying to set to show in labels
title = songtitle.text
artist = songartist.text

Viewing all articles
Browse latest Browse all 15458

Latest Images

Trending Articles



Latest Images

<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>