LUA support for changing sound pitch IE doppler effects?

LUA support for changing sound pitch IE doppler effects?

Discuss Lua based Spring scripts (LuaUI widgets, mission scripts, gaia scripts, mod-rules scripts, scripted keybindings, etc...)

Moderator: Moderators

Post Reply
User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

LUA support for changing sound pitch IE doppler effects?

Post by Zpock »

How much work would be needed to get this? I have no idea really but doesn't openal or whatever spring uses have support for these things, that pretty much just needs to be hooked into by some LUA command via the engine?
trepan
Former Engine Dev
Posts: 1200
Joined: 17 Nov 2005, 00:52

Re: LUA support for changing sound pitch IE doppler effects?

Post by trepan »

I suggest you forget "lua"ing doppler as a feature.
It's best supported natively as an engine feature.
For OpenAL, all that really needs to be done is to
setup the sound sources with velocities. Afaik, the
same is true for DxSound.
User avatar
Argh
Posts: 10920
Joined: 21 Feb 2005, 03:38

Re: LUA support for changing sound pitch IE doppler effects?

Post by Argh »

Um, we'd also need some way to parametrically turn that off, too... think of the per-frame checks that would involve... I know doppler's used a lot in flight-sims and space games, but meh, they're dealing with very few sound sources, and they probably don't bother doppler'ing stuff past a certain volume threshold or distance, to save CPUs. Smoke and mirrors ;)
User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

Re: LUA support for changing sound pitch IE doppler effects?

Post by Zpock »

Yeah, that's what I thought, that you basically just tell what the velocity is and openal does the rest, so basically just an extra parameter on playsound? What I'm wondering is if you just tell the speed at starting the sound file or can you supply the velocity over time as the sound plays?
User avatar
KDR_11k
Game Developer
Posts: 8293
Joined: 25 Jun 2006, 08:44

Re: LUA support for changing sound pitch IE doppler effects?

Post by KDR_11k »

Argh wrote:Um, we'd also need some way to parametrically turn that off, too... think of the per-frame checks that would involve... I know doppler's used a lot in flight-sims and space games, but meh, they're dealing with very few sound sources, and they probably don't bother doppler'ing stuff past a certain volume threshold or distance, to save CPUs. Smoke and mirrors ;)
The biggest draw would still be the sound itself, the soundcard can only handle so many sounds at a time and an on-board card would use the CPU for that. I expect the doppler stuff to be fairly trivial in comparison.
User avatar
Zpock
Posts: 1218
Joined: 16 Sep 2004, 23:20

Re: LUA support for changing sound pitch IE doppler effects?

Post by Zpock »

Ok this is the result of my attempt:

listen closely to 1min mark when music goes down.

http://www.youtube.com/watch?v=ZI7cuOuanzQ
Post Reply

Return to “Lua Scripts”