[openal] Programmatic access to sounds played through OpenAL

Aleksei Petrenko petrenko at usc.edu
Sat Jul 18 04:58:04 EDT 2020


Hi everyone,

I am looking for help with a rather unusual problem.
For a reinforcement learning project, we want to run a computer game much
faster than realtime, and on top of capturing the rendered output, we also
want to capture the sound that the player perceives.

Naturally, the game uses OpenAL, which I have very little experience with.
I understand that the game defines multiple emitters, filters, there's
Doppler shift depending on object velocities, etc. So, the sound
pipeline is rather complicated and the final sound is highly non-trivial. I
cannot just rewrite everything without using OpenAL.

My question is, is it possible to get programmatic access to the sounds
played during every particular frame of the game?

An example to be more concrete. Let's say the normal framerate of the game
is 60FPS. I am running the game 10 times faster than realtime, so at 600FPS
(10x is not important, I want to run the game as fast as hardware allows,
the exact speedup is not known). At some point, a game event triggers a
sound that under normal circumstances would play for 1 second, so for 60
game ticks. In my fast simulation it only lasts 0.1 seconds, and the same
60 game ticks.

Can I record the sound samples that would have been played during every
game tick if it ran normally, such that if I record everything and play it
back at the normal speed, it would be indistinguishable from normal sounds?

This question on SO didn't get much attention:
https://stackoverflow.com/questions/62945506/programmatic-access-to-a-sound-played-through-openal
<https://urldefense.com/v3/__https://stackoverflow.com/questions/62945506/programmatic-access-to-a-sound-played-through-openal__;!!LIr3w8kk_Xxm!5zD0XPJENUmu2H1nDIKTLu7b6izQvainqM5bIciOFWAaCUHNL4r6xTAc2XleU4g$>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://openal.org/pipermail/openal/attachments/20200718/4dd50a36/attachment.htm>


More information about the openal mailing list