Not logged inGosu Forums
Forum back to libgosu.org Help Search Register Login
Up Forum
Search
Topic Current time position and total length of SampleInstance By jbe Date 2012-09-19 15:41
Haha, that is brilliant, why didn't i think of that! Maybe not the most straightforward solution but it does have that cosy duct tape vibe. And come to think of it, i could just hook in some code that gets them while the game runs (meaning while i test and debug); and it would kind of sort itself out. Weird enough, but should work as a workaround.

I'll add a ticket then. I'd try writing a patch too if i had any experience with c++ or openAL, but that's probably above me for now. Thanks again, and yeah, certainly no need to hurry, but i'll put the ticket there in case.
Topic Current time position and total length of SampleInstance By jbe Date 2012-09-19 11:32
Hey.

First of all, thanks for making Gosu available. It's been a lot faster and easier to get around than ruby-sdl-ffi, and i love the idea of being able to write an entire game in just Ruby; it's kind of fun. And the API is very easy to use too (never mind the fact that the window scales itself down to show the taskbar when it isn't fullscreen, i somehow found out what was going on eventually :P).

I've been experimenting with extending the base classes to add a few bits and bobs, but i'm wondering about one thing in particular. I'm planning to use some ambient looping samples along with the music in the project i'm working on, so I am writing a simple SampleLoop class that retriggers a sample a few seconds before it ends, as a sort of primitive crossfade. -- Actually, the fade could be automated in Ruby as well for that matter. However, as far as i know, there is no way to detect the sample length and playback position in the Gosu Ruby API. Or did i overlook something?

If not, is there any chance of this showing up a future release?

As a clumpy workaround, i could read the system time when a sample starts, compare now and then, and have the sample lengths stored somewhere (afaik, there are no suitable gems to check it). I can live with the first part, but i don't like hardcoding sample lengths..

What do you guys think about this?

Powered by mwForum 2.29.7 © 1999-2015 Markus Wichitill