Author Topic: Suggestions for deterministic BASS_ChannelGetData results  (Read 725 times)

BrianDFS

  • Posts: 7
I'm new to Bass as of yesterday.  After taking a look at the spectrum.c example, I've got music up and playing as well as good FFT data coming back from BASS_ChannelGetData.

My next task is to ensure that the every time I play song x, I get back exactly the same FFT results at time y.  Since Bass plays and samples streams asynchronously, I'm in need of suggestions regarding how to achieve this.  Hopefully it's simple?

Thanks.

Ian @ un4seen

  • Administrator
  • Posts: 20424
I think you will have to use a decoding channel (created with the BASS_STREAM_DECODE flag) alongside the normal playback channel. You could then seek to the wanted position (via BASS_ChannelSetPosition), before making the BASS_ChannelGetData call to get the FFT data at that position. If you're dealing with MP3 files, you should also use the BASS_STREAM_PRESCAN flag, so that the seeking is precise.

BrianDFS

  • Posts: 7
I think you will have to use a decoding channel (created with the BASS_STREAM_DECODE flag) alongside the normal playback channel. You could then seek to the wanted position (via BASS_ChannelSetPosition), before making the BASS_ChannelGetData call to get the FFT data at that position. If you're dealing with MP3 files, you should also use the BASS_STREAM_PRESCAN flag, so that the seeking is precise.

Excellent.  I'd seen a suggestion elsewhere on these forums regarding BASS_ChannelSetPosition, so it sounds like that's the way to go.  Once I get around to implementing this, I'll report back.  Thank you for the quick reply.