Re: non-realtime sound simulation (simulating only N msec perframe)

Jason Daly <[email protected]>
Newsgroups gmane.comp.lib.openal
Message-ID <[email protected]>
[email protected] wrote:
> Hi guys, this is my first work with OpenAL, I'm new here, and if this is a stupid question don't hesitate to let me know. :) Also, if you need more information in order to answer the question, I will do my best to answer.
>
> So here's the scenario: I am modifying a game I play (Alien Arena) which uses openAL for sound. I am adding a feature which allows you to export videos. The export feature lets you set a desired output framerate, then it changes the main loop so that exactly 1000/framerate milliseconds are simulated every frame. The idea is that you first record a demo normally, then play it back and have it export the video.
>
> Is there a way to do this with the audio in openAL as well? So if the export framerate is 25, can I have openAL simulate 40 Milliseconds and then just stop? Also, can I have it "render" the mixed PCM sound into a buffer instead of (or as well as) playing it on the soundcard?
>
> The reason I ask is that all the tutorials and documentation I have seen refer to alSourcePlay and alSourceStop, but nothing about setting an amount of time to simulate before stopping automatically. 
>   

Hi, Max,

There is no provision for this kind of functionality in the OpenAL 
spec.  I haven't heard of any of the implementations providing anything 
like this either.

That said, I wouldn't think it would be all that hard to hack into an 
implementation, if you're so inclined.  Since you're capturing video, 
I'm guessing you don't need to actually play the audio at the same time, 
so you wouldn't need to talk to hardware at all (this would likely be 
much more complicated if you did).

If you start with OpenAL-Soft, you can look at the "wave" backend, which 
renders to a .wav file instead of to audio hardware.  Then, you can play 
with the code (probably in the ALC area) to get it to execute the 
start/stop functionality you want.

--"J"

_______________________________________________
Openal mailing list
[email protected]
http://opensource.creative.com/mailman/listinfo/openal
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.