0
0

I’m playing streams…iis there any callback which executes at the time parameter.
eg. song lengthms is 300000.
callback must write “hello world” when song come to 270000 ms.
Should be useable with mp3 and ogg files.
Yes I know that I can do that via timer…..

tnx

  • You must to post comments
0
0

I’m not aware of a callback that can be set on a timer, but one way to do it
without using a manually programmed timer would be to call FSOUND_Stream_AddSynchPoint
– you would have to work out how many samples 270000 ms equates to
(using sample rate & bit depth)

Then you can set a sync callback by calling FSOUND_Stream_SetSynchCallback
which will be called at the sync point you set

  • You must to post comments
0
0

Can you explain this a bit …I mean calculating of num of samples etc..I’ve tried
with AddSynchpoint but it doesn’t work

  • You must to post comments
0
0

OK,

The way to think about it is like this:

Each “sample” contains a number of bits that represent the sample at the
current timeslice – this is bit depth
e.g. CD bitdepth is 16 – uses 16 bits to represent one sample

Frequency is then how many samples per second
e.g. CD frequency is 44100 – that’s 44100 samples per second

so to calculate how many samples in 5 seconds you go

16 * 44100 * 5 = 3 528 000

You can find the sample rate of the sound with FSOUND_Sample_GetDefaults
you pass in pointers to int’s one of which is the default frequency (you can
just pass in NULL for the ones you don’t need)

Not sure how to get bit depth of a sample though – and if you’re using
vbr mp3’s it becomes trickyer

maybe someone else can help here??

edit:

Not sure what happens for stereo samples – maybe need to times by two again? – maybe not?

  • You must to post comments
0
0

Thanks Brett but I’m using linux ,so is there any chance to get libfmod*.so instead of .dll ?

  • You must to post comments
0
0

ok , tnx…anyway I’ll buy license after 3.62 released :)

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.