Author Topic: Question about sample data  (Read 40 times)


  • Posts: 1
Question about sample data
« on: 14 Mar '19 - 01:10 »
Hi and thank you for this awesome audio library.

I'm trying to play a MP3 file and I want to get wav data that is being played that moment, I'm trying to send it to my server to stream it for others somehow, I want something just like record callback, so what function I should use? BASS_SampleGetData? BASS_ChannelGetData? What is going to be the parameters?

Ian @ un4seen

  • Administrator
  • Posts: 21593
Re: Question about sample data
« Reply #1 on: 14 Mar '19 - 15:42 »
To receive all of the sample data as it is decoded/played, you should set a DSP function on the file's stream via BASS_ChannelSetDSP. You can then do whatever you want with the data in that function. If you want to serve the data to others, you may want to have a look at the BASSenc add-on's server feature, eg. BASS_Encode_ServerInit. Please see the documentation for details on the mentioned functions.