Author Topic: BASS_ChannelGetInfo  (Read 852 times)

kio2008

  • Posts: 57
BASS_ChannelGetInfo
« on: 1 May '14 - 10:37 »
Hi at all,
I want get information on type stream when i use

stream = Bass.BASS_StreamCreateURL(Url, 0, BASSFlag.BASS_STREAM_DECODE, Nothing, Nothing)

Url   "http://wma06.fluidstream.net:4610"

When I use this statements :
  Dim info As New BASS_CHANNELINFO
  Bass.BASS_ChannelGetInfo(stream, info)

Inside info I get
ctype = BASSChannelType.BASS_CTYPE_STREAM_MF

Then I use :

Dim tagPTR As IntPtr = Bass.BASS_ChannelGetTags(stream, BASSTag.BASS_TAG_WAVEFORMAT)
Dim tags As String() = Utils.IntPtrToArrayNullTermUtf8(tagPTR)

I get 2 items inside tags.

Inside Tags(0) I get strange character
Instead Tags(1) I get "V

what mean this ? what's type stream ?

Thank you very much

Ian @ un4seen

  • Administrator
  • Posts: 20426
Re: BASS_ChannelGetInfo
« Reply #1 on: 2 May '14 - 13:45 »
The BASS_TAG_WAVEFORMAT option will deliver a pointer to a WAVEFORMATEX structure. The question is how to access that in .Net :)

I'm not a .Net user myself, but perhaps something like this?

Code: [Select]
Dim tagPTR As IntPtr = Bass.BASS_ChannelGetTags(stream, BASSTag.BASS_TAG_WAVEFORMAT)
Dim wf As WaveFormatEx = Marshal.PtrToStructure(tagPTR, typeof(WaveFormatEx))

radio42

  • Posts: 4576
Re: BASS_ChannelGetInfo
« Reply #2 on: 2 May '14 - 14:37 »
Bass.Net already contains an appropriate overload and defined the WAVEFORMATEXT class as needed:

See the following method: "Bass.BASS_ChannelGetTagsWAVEFORMAT"