22 May '13 - 20:56 *
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 to stop a file playing at a certain point ?  (Read 301 times)
Asger-P
Posts: 11


« on: 3 Jan '12 - 00:51 »
Reply with quoteQuote

Hi

Is it possible to make a filestream stop playing after e.g. 2min. 54sec. of playing and receive a callback when it does stop ?

I have learned how to get a callback when the stream reaches its natural end, like this:
BASS_ChannelSetSync( FChannel, BASS_SYNC_END|BASS_SYNC_MIXTIME, 0, EndTrackProc, FHandle );

but how do I do the same for a specified time ?

Thanks in advance
Best regards
Asger-P
Logged
ken
Posts: 630


« Reply #1 on: 3 Jan '12 - 08:47 »
Reply with quoteQuote

Hi

Is it possible to make a filestream stop playing after e.g. 2min. 54sec. of playing and receive a callback when it does stop ?

You should use BASS_ChannelSetSync with flag BASS_SYNC_POS. Put your 2,54 time as the param (in bytes). In the sync proc/callback you call  BASS_ChannelStop.

Logged
Asger-P
Posts: 11


« Reply #2 on: 3 Jan '12 - 11:05 »
Reply with quoteQuote


You should use BASS_ChannelSetSync with flag BASS_SYNC_POS. Put your 2,54 time as the param (in bytes). In the sync proc/callback you call  BASS_ChannelStop.


Thanks Ken

Why didn't I think of that I knew I could set a syncpos, I saw that in the custloop example I just never thought of stopping the channel my self, when getting the call back......

Thanks for waking me!

Best regards
Asger-P
Logged
Pages: [1]
  Reply  |  Print  
 
Jump to:  

Powered by SMF 1.1.18 | SMF © 2013, Simple Machines