Author Topic: Internet stream > BASSBuffer  (Read 159 times)

TBacker

  • Posts: 5
Internet stream > BASSBuffer
« on: 19 Jan '18 - 06:41 »
Is there a simple way to get the decoded PCM output of a URL stream so I can put it into a ring buffer (aka BASSBuffer)?  I don't see any direct way from the URL stream object.

I've been tinkering for hours with various schemes, and it seems like the only way I could do this is to have to use the DOWNLOADPROC (which is in the streams encoded format), and then manually handle the decoding myself before depositing the data into the buffer.  Kind of a pain considering the stream object can internally decode to PCM to feed devices directly.  I really don't want to get into having to manually handle codec choice and configuration for the wide variety of streams out there.

Ideas appreciated.  In the meantime, I'll keep mulling this over and trying things.

TBacker

  • Posts: 5
Re: Internet stream > BASSBuffer
« Reply #1 on: 19 Jan '18 - 13:57 »
Sorry folks - I think I've been a bit thick.  Looks like I can create a thread that pulls decoded PCM from BASS_ChannelGetData and places it tin the ring buffer.  For some reason my brain equated BASS_ChannelGetData with FFT and I didn't think about it as a PCM stream access point.


Ian @ un4seen

  • Administrator
  • Posts: 20764
Re: Internet stream > BASSBuffer
« Reply #2 on: 19 Jan '18 - 14:45 »
Yes, using BASS_ChannelGetData (after adding the BASS_STREAM_DECODE flag to the BASS_StreamCreateURL call) is indeed the way to go. BASS_ChannelGetData will only deliver FFT data when the FFT flags are used with it; the data will otherwise be PCM.