18 May '13 - 15:15 *
Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
 
   Home   Help Search Login Register  
Pages: [1]
  Reply  |  Print  
Author Topic: BASS_ChannelGetData(chan, NULL,BASS_DATA_AVAILABLE); and ASIO  (Read 362 times)
dts350z
Posts: 17


« on: 8 Jun '12 - 23:29 »
Reply with quoteQuote

I have working code for playing back data I'm streaming with both regular and ASIO devices.

However, when I use  BASS_ChannelGetData(chan, NULL,BASS_DATA_AVAILABLE) with ASIO devices I get 4294967295 returned instead of something like 270336 (which get with a non ASIO device).

4294967295 is 32 bits of all ones.

This is a 6 channel stream, loaded via BASS_StreamPutData. I'm on windows 7.
Logged
Ian @ un4seen
Administrator
Posts: 15244


« Reply #1 on: 11 Jun '12 - 15:33 »
Reply with quoteQuote

The BASS_DATA_AVAILABLE option retrieves the amount of data in the playback buffer, so it doesn't apply to a "decoding channel" (as you would use with ASIO output) and your request will fail (4294967295 = 0xFFFFFFFF = -1). To get the total amount of buffered data, you should also check the BASS_StreamPutData return value, like this...

DWORD buffered=BASS_StreamPutData(handle, NULL, 0); // get the amount of queued data
DWORD playbuf=BASS_ChannelGetData(handle, NULL, BASS_DATA_AVAILABLE); // attempt to get the amount in the playback buffer
if (playbuf!=(DWORD)-1) buffered+=playbuf; // if successful, add it to the queued amount
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines