0
0

Why is it that GetTime does not work for custom streams created with Stream_Create? Am I just being dumb?

  • You must to post comments
0
0

Yes, i do this in a DSP callback, the user can retrieve the exact time elapsed by setting his function callback.
I seek in samples then i convert the current sample position to ms, for now this method works for modules, ogg, mp3, flac, mpc, aac and formats supported by libsndfile.

  • You must to post comments
0
0

Post the code you are using. When creating a custom stream I dont believe that FMOD knows the current position because you are feeding it the audio. But I’m not sure because I’ve only used custom streams once for the APE format.

  • You must to post comments
0
0

That’s exactly what I’m doing…using a custom stream for APE.

  • You must to post comments
0
0

I don’t know if FMOD GetTime should work, but i used return pAPEDecompress->GetInfo(APE_DECOMPRESS_CURRENT_MS); of the APE decoder. But it is only accurate with small buffersizes

good luck

Chris

  • You must to post comments
0
0

It is possible to get the time by converting the samples processed to a relative time (see the sourcecode of the FMOD addon)

  • You must to post comments
0
0

that’s true, but if you decode a lot samples at a time, you still don’t know the exact position.
if you decode for example 2sec*44100 samples, you will get:
0:00
0:02
0:04

But maybe there is another way instead of using a smaller buffer ?? :(

  • You must to post comments
0
0

You can calculate the processed sample in the mix time so before the sound is sent to the soundcard, this is how i do in my crappy sound lib with success.

  • You must to post comments
0
0

[quote="KarLKoX":37baqmri]It is possible to get the time by converting the samples processed to a relative time (see the sourcecode of the FMOD addon)[/quote:37baqmri]

What addon?

Chris, I am doing just what you suggest but, as you pointed out, that is not the currently playing time but the decoded time. I discovered that I needed to decode a lot of samples at a time to feed fmod reliably – so the time jumps in ~ 2 sec increments.

My thought is that the stream started at a particular time and there is no technical reason (as far as I know) that fmod could not return the current time….it should have all the information it needs to do so.

  • You must to post comments
0
0

[quote="KarLKoX":3ce02kzr]You can calculate the processed sample in the mix time so before the sound is sent to the soundcard, this is how i do in my crappy sound lib with success.[/quote:3ce02kzr]

Never thought of that ! 😀 You mean just in a DSP-callback???

EDIT:
But is it possible to get the current MS if you just seeked??

  • You must to post comments
Showing 9 results
Your Answer

Please first to submit.