22 May '13 - 19:02 *
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: How often is the StatusProc ("DownloadProc") called?  (Read 417 times)
Bert
Posts: 159


« on: 25 Jan '12 - 13:46 »
Reply with quoteQuote

Hi,
i'm recording a stream after detecting a defined soundlevel. Before i have silence on the stream.
I set a var to true an in the STATUSPROC the buffer is written then to the disk.
But i have the sound only after 8-9 seconds captured.

How often ist the StatusProc called from BASS?

Thank you,
Bert
Logged
Ian @ un4seen
Administrator
Posts: 15269


« Reply #1 on: 25 Jan '12 - 18:02 »
Reply with quoteQuote

Your DOWNLOADPROC function is called straight after BASS has received data from the server. Note that that data will be ahead of what's currently being heard due to the download buffer (BASS_CONFIG_NET_BUFFER) and the playback buffer (BASS_CONFIG_BUFFER), and possibly other buffering in the decoder. So if you're basing your file writing switch on what's currently heard and you want the writing to start from around that point, then you would need to keep some data buffered (eg. put it in a circular buffer in the DOWNLOADPROC) and write that to the file first. It may be tricky to workout the correct length for your buffer, but you could start by using the download buffer length available from BASS_StreamGetFilePosition (with BASS_FILEPOS_END).
Logged
Bert
Posts: 159


« Reply #2 on: 25 Jan '12 - 19:15 »
Reply with quoteQuote

Thank you, Ian!
I'll give your idea a try!
 Smiley
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines