0
0

I’m using FMOD to sync sound to a timeline by adjusting the audio frequency.

It works good playing in reverse (negative FSOUND_SetFrequency) because I request a new audio position at each frame (or so), so the buffer keeps refilling.
–note: “Playing a sample backwards” on the forum
(this doesn’t work well with highly compressed files, but thats ok)

But when I stop playing backwards, and start playing forwards again the song plays forwards, but the buffer keeps playing backwards until I reload the audio file.

I’m using 3.50

  • You must to post comments
0
0

[quote:1wba5d99]I’m using FMOD to sync sound to a timeline by adjusting the audio frequency.

It works good playing in reverse (negative FSOUND_SetFrequency) because I request a new audio position at each frame (or so), so the buffer keeps refilling.
–note: “Playing a sample backwards” on the forum
(this doesn’t work well with highly compressed files, but thats ok)
[/quote:1wba5d99]

[color=yellow:1wba5d99]I know this was a long time ago and I hate bringing stuff up again but I was just curious on how this guy was requesting a new audio position at each frame. I would like to experiment with this but have had no luck with the documentation. Could anybody include some examples possibly of what this guy is doing with the frames and how he refills the buffer?[/color:1wba5d99]

By the way I am using VB6 for my programming

Thanks so much

  • You must to post comments
0
0

I know everybody is busy and all with everyday things but if somebody could tell me in a quick reply if what he is doing is possible or not?

He sounds preaty damn confident that he accomplishing this. Anyways is he just recording the FSOUND_Stream_GetTimeMs and then Setting the time to that as the Frequency is in the negative?

Any ideas guys and gals?

Thanks

  • You must to post comments
0
0

I was testing playing backwards again with the latest & gratest FMOD 3.71….
Sorry I havent been around (nor updated my email – but it is now), I graduated about 18 months ago, and have veen looking for a job until a few months ago.

Short story: my tricks worked much better with v3.51? — or at least seemed to on a 5x slower CPU & win95/98 instead of 2000. — less chance of tricky multithread problems showing up.

Now the problem I’m having is, the whole OS becomes unresponsive when FMOD runs out of buffer while playing backwards (or because of something my program does, or doesnt do when this happens, I’m still looking into it).

The main thing to keep in mind is, I’m not interested in perfect audio, but in keeping the audio in sync with a timeline (within a few frames at all times, and closer over the long run) — If the timeline is jerky, the audio quality will suffer.

Overview:
A program is playing a (video, 30 frames/sec) timeline in real-time, skipping frames as necessary to keep up.
(the program has a builtin feature for syncing audio, but it loads the WHOLE file into memory, only accepts uncompressed WAV, doesnt remember which file goes with the project…. so mine is a definite improvement)

A plugin (my code) for this program receives events for frames (those that arent skipped) as they are encountered. The plugin calculates the necessary frequency, and time to send to FMOD —
FSOUND_Stream_SetTime() & (optionally) FSOUND_SetFrequency()

Ideally, the plugin gets triggered every 33msec, so a 50msec buffer for FMOD is enough for smooth playback (double buffered), without too much latency & waste if the audio needs to skip & jump.

–This works excellently playing forwards at varying speeds IF: 1)you have an accurate high resolution timer, 2)you avoid SetTime in favor of SetFrequency (because SetTime clears the play buffer), and setting that only if absolutely necessary.

(Sentax, I’d recommend “CCRP High Performance Timer objects” (free) for VB6, something this crazy has no chance of working with the standard VB timer)

–Playing backwards is another story. Way back when I started this discussion thread, backwords worked for me, although a bit choppy, because I called SetTime every frame — and you must call SetTime regularly before the buffer runs out.

The original problem was the buffer got stuck in reverse, so I stopped using that feature & since then I’ve optimized for smoother forward playback by not calling SetTime as often…. So I’ve basically given it up.

If it was possible to get a callback from fmod when (or before) the buffer runs out while going backwards, then it would be easier to ‘manually’ refill the buffer with SetTime. And if that were possible, it might be possible to double/triple buffer streaming backwards seamlessly??? (but those are some rather big if’s for a nonessential feature)

  • You must to post comments
Showing 3 results
Your Answer

Please first to submit.