Cheers!
Edit:1. Still getting some heavy crackeling background sounds out of nowhere.
On some channels they are very seldom on others like the example one there are insane.
2. Meta data "BASS_TAG_ICY"
Does it also give some like the current title. Couldn't find a name tag for this?
' Play a shoutcast stream...
'
SuperStrict
Framework BaH.Bass
Import BRL.GLMax2D
Import BRL.StandardIO
If Not TBass.Init(-1,48000,0,Null,Null) Then
DebugLog "Can't initialize device : " + TBass.ErrorGetCode()
End
End If
BASS_SetConfig(BASS_CONFIG_NET_PLAYLIST,0) ' enable playlist processing
BASS_SetConfig(BASS_CONFIG_NET_PREBUF,0) ' minimize automatic pre-buffering, so we can do it (And display it) instead
Local isMod:Int = False
' rocking!
Global url:String = "http://194.158.114.68:5000"
'Global url:String = "http://scfire-nyk-aa02.stream.aol.com:80/stream/1074"
Global channel:TBassChannel = New TBassStream.StreamCreateURL(url, 0, BASS_SAMPLE_FLOAT|BASS_STREAM_STATUS|BASS_STREAM_AUTOFREE, Null, Null)
If channel Then
Local length:Long = channel.GetLength(BASS_POS_BYTE)
If Not channel.Play(False) Then
DebugLog "can't play... : " + TBass.ErrorGetCode()
'Exit
End If
Graphics 640, 480, 0
Local active:Int = channel.IsActive()
While active And Not KeyDown(key_escape)
Cls
' display some stuff And wait a bit
Local _left:Int, _right:Int
channel.GetLevel(_left, _right)
Local pos:Long = channel.GetPosition(BASS_POS_BYTE)
Local time:Double = channel.Bytes2Seconds(pos)
DrawText "position - " + pos, 20, 50
DrawText "elapsed - " + Int(time/60) + ":" + Int(time Mod 60), 20, 65
If isMod Then
Local low:Int, high:Int
pos = channel.GetPositionLowHigh(BASS_POS_MUSIC_ORDER, low, high)
DrawText " - " + low + ":" + high, 50, 80
End If
If active = BASS_ACTIVE_STALLED And TBassStream(channel) Then ' playback has stalled
DrawText "-- Buffering : " + TBassStream(channel).GetFilePosition(BASS_FILEPOS_BUFFER) + " --", 20, 90
Else
Local lwidth:Int = _left / 410.0
DrawRect 100 - lwidth, 100, lwidth, 20
DrawRect 110, 100, _right / 410.0, 20
End If
DrawText "CPU - " + TBass.GetCPU(), 240, 50
Get_StreamTagIDs()
Delay 100
Flip 1
active = channel.IsActive()
Wend
'End If
'Else
' DebugLog "didn't load : " + TBass.ErrorGetCode()
End If
TBass.Free()
End
Function Get_StreamTagIDs()
' output some stream information
If channel.Play(False) Then
Local tags:String[] = channel.getTags(BASS_TAG_ICY)
Local ypos:Int=150
For Local s:String = EachIn tags
If s <> Null Then
DrawText s, 20, ypos
'DebugLog s
ypos=ypos+15
EndIf
Next
EndIf
End Function
Still experimenting around....