Join us at the Oolite Anniversary Party -- London, 7th July 2024, 1pm
More details in this thread.

Positional audio and ambient sounds.

An area for discussing new ideas and additions to Oolite.

Moderators: winston, another_commander

User avatar
zeep
Competent
Competent
Posts: 33
Joined: Sun Jan 07, 2007 1:10 pm

Positional audio and ambient sounds.

Post by zeep »

Over half a year ago i asked the dev for options regarding positional audio and ambient sounds. Positional audio means that when a ship passed you on the left side, and it emits some engine sound, you will also hear it passing on your left. Basically positional audio is the most important and from it can come ambient sounds.

I don't know what this community's view is on adding more sound too Oolite, but being a sound engineer i see a lot of possibilities. Stations produce ambient sounds, your ship etc. (Hum, metal screech, computer sound, ships internal and external views).

Ahruman said this on the subject:
Ahruman wrote:
.. the sound code is custom. I started on support for positional audio, but the problem lies in making the rest of the game tell the sound code where sounds are supposed to be played… this is a heavy rearchitecting thing, regardless of the underlying sound code..
He doesn't say, "No it's impossible!". ;)

Maybe with 1.70 the possibilities are nearer?
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

No.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

Hello zeep,

there is already a way to play specific sounds. playSound. I don't know if it's working on Macs or Linux, but for Windows it is working (Version 1.65 and 1.69.1-test / wav + ogg). I've used it for my own OXP, but it seems that there is no kind of method to control if a specific sound is running (by the way: what means isPlaying? Is it implemeted and how does it work?) and no way to stop or fade something. I've tried playCustomSound but it doesn't work. And missionMusic does not work on Windows.

I would like to see something like a radiostation while STATUS_IN_FLIGHT that chooses songs randomly, but I don't know if there is any chance to control it. Maybe there are other restrictions like memory usage,... And think about that there are a lot of players running Oolite on somewhat slow computers - so all sound files have to be small.

And last but not least the ambience thing. I think it is a good idea using some ambience effects (maybe for the spacer bar and for Equipment-GUIs), but without any control method it will clash with other sounds (mission screens,...).

EDIT: And a library of free music would be cool.
User avatar
zeep
Competent
Competent
Posts: 33
Joined: Sun Jan 07, 2007 1:10 pm

Post by zeep »

If Ahruman (or 3rd party) ever programs more abilities for sound emitting in Oolite, i would be glad to help out adding sounds. I'm positive Oolite will have so much more immersive effect on players when there's a audible sense of life to go with the rest of this sublime game.

I'm on the pc myself so if we're missing out on more sound abilities here i feel bad about that..

For what it's worth i'm doing a soundpack for now. Just some sparse sounds to replace most of the basic sounds. It's not much work but when i feel good about it i'll release it.
User avatar
nijineko
---- E L I T E ----
---- E L I T E ----
Posts: 353
Joined: Wed Jul 04, 2007 3:37 pm
Location: two strange quarks short of a graviton....
Contact:

Post by nijineko »

even if advanced sound support would be a little much at this time without major restructuring, what about adding support for code-activated sounds which can be targeted at specific sound channels?
arukibito ga michi wo erabu no ka, michi ga arukibito wo erabu no deshou ka?

Image
Play games. Win Amazon gift cards! Brag. Repeat.
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

So lets make a test. Download this OXP <removed>, install it, launch from station and press F7 (SYSTEM_DATA_SCREEN). Can you hear it? Please don't forget to post what kind of OS you are using.
Maybe we can find a method that will work for all OS.

EDIT: I've disabled this link. If you need a test take a look in the hyperradio.oxp http://wiki.alioth.net/index.php/Hyperradio_js_OXP or https://bb.oolite.space/viewtopic.php?t=4067
Last edited by Svengali on Sat Jan 15, 2011 1:17 pm, edited 2 times in total.
User avatar
zeep
Competent
Competent
Posts: 33
Joined: Sun Jan 07, 2007 1:10 pm

Post by zeep »

Works here! Winxp pro sp2.

So playing a music fike is possible for menu's. Is it also possible to stop it when i.e. another theme starts playing? I did see something mentioned in your code so i guess it works that way too.

Looping sounds is unsupported though afaik, so that option will have to be added or any ambient sound will have to be a long file which is a bad route to take.

Can two sounds play together if you'd were to make another tune play for i.e. menu 6? Will different sound cancel eachother out? So how many sounds can play at the same time?

I have to learn this scripting fast!
Last edited by zeep on Sun Dec 02, 2007 6:05 pm, edited 1 time in total.
User avatar
TGHC
---- E L I T E ----
---- E L I T E ----
Posts: 2157
Joined: Mon Jan 31, 2005 4:16 pm
Location: Berkshire, UK

Post by TGHC »

I'm really liking this, I wish you well in your endeavours.
The Grey Haired Commander has spoken!
OK so I'm a PC user - "you know whats scary? Out of billions of sperm I was the fastest"
User avatar
zeep
Competent
Competent
Posts: 33
Joined: Sun Jan 07, 2007 1:10 pm

Post by zeep »

I'm already mixing sounds for different states in the game! Here's hoping for more possibilities..
User avatar
Svengali
Commander
Commander
Posts: 2370
Joined: Sat Oct 20, 2007 2:52 pm

Post by Svengali »

Sorry for hijacking this thread.
TGHC wrote:
I'm really liking this, I wish you well in your endeavours.
Thanks for your answer . But what does it exactly mean? Is it working on your computer and what kind of OS is it? As you can see I'm very interested in finding a solution for that.

zeep wrote:
So playing a music fike is possible for menu's.
Not only for menu's. Take a look in my OXP (localhero thread). There it is used as commsMessage, too.
Is it also possible to stop it when i.e. another theme starts playing? I did see something mentioned in your code so i guess it works that way too.
That is just a prevention. If the player stays on the SYSTEM_DATA_SCREEN (for more than a few secs) he would here more than one song (if there is a definition in descriptions.plist) at the same time. So I've implemented a 'counter' (clock_mins_number doesn't work). And if the same song is started again, that is no problem. The running theme stops and will be restarted. But stopping a running theme? I don't know. There are a lot of routines in the SDL-thing, but I'm no progger at all, so maybe this will end in trial and error :evil: .

But I'm willing to do this :shock: (Must be a maso)
User avatar
Commander McLane
---- E L I T E ----
---- E L I T E ----
Posts: 9520
Joined: Thu Dec 14, 2006 9:08 am
Location: a Hacker Outpost in a moderately remote area
Contact:

Post by Commander McLane »

Svengali wrote:
So I've implemented a 'counter' (clock_mins_number doesn't work).
Works from 1.70 onwards. But the relevant time counter is clock_number anyway, which always worked.

*****

Generally for ambient sound: May I just throw in a quick reminder here, that there is no transmission of soundwaves in vacuum, so, contrary to what we are used to from SF-movies, space is quiet? :oops: (Myself I actually play most of the time with sound completely off, but admittedly for other reasons than realism. Has more to do with not waking up wife etc. :wink:)
User avatar
zeep
Competent
Competent
Posts: 33
Joined: Sun Jan 07, 2007 1:10 pm

Post by zeep »

With regards to possible music; I'm thinking lush / easy listening. Fitting the theme, not setting the tone. But ofcourse, different people have different taste so the end user can always disable stuff, even if it's as simple as just deleting some files. Or with a custom(izable) install package. But i'm ahead of myself, first things first, we'll see how everything goes.
User avatar
JensAyton
Grand Admiral Emeritus
Grand Admiral Emeritus
Posts: 6657
Joined: Sat Apr 02, 2005 2:43 pm
Location: Sweden
Contact:

Post by JensAyton »

I should probably mention that 1.71 is intended to have JavaScript classes for dealing with one-shot sounds and music. But not positionally.
User avatar
Disembodied
Jedi Spam Assassin
Jedi Spam Assassin
Posts: 6883
Joined: Thu Jul 12, 2007 10:54 pm
Location: Carter's Snort

Post by Disembodied »

Commander McLane wrote:
Generally for ambient sound: May I just throw in a quick reminder here, that there is no transmission of soundwaves in vacuum, so, contrary to what we are used to from SF-movies, space is quiet? :oops: (Myself I actually play most of the time with sound completely off, but admittedly for other reasons than realism. Has more to do with not waking up wife etc. :wink:)
True, but I think we can assume we're dealing with highly sophisticated command consoles here, which can use all sorts of gizmos to expand our perceptions (e.g. enabling us to see laser beams, for a start...). If you want to rationalise Star Wars-esque "zhhwhooo" noises as ships fly past, you could imagine a system which was cunningly designed to feed information about the surrounding environment through a variety of sensory channels. Youc cabin could be fitted out with Doolby surround-sound speakers, giving you simulated audible as well as visual information. Maybe even, depending on the species, chemical cues too: if you're an insectoid, a pheromonal squirt onto your antennae from the upper-rear-left, signalling a hostile presence there, might enable you to react far more quickly than visual information only.
User avatar
nijineko
---- E L I T E ----
---- E L I T E ----
Posts: 353
Joined: Wed Jul 04, 2007 3:37 pm
Location: two strange quarks short of a graviton....
Contact:

Post by nijineko »

and there's a perfect canidate for the 'your-ad-here' oxp! =D
arukibito ga michi wo erabu no ka, michi ga arukibito wo erabu no deshou ka?

Image
Play games. Win Amazon gift cards! Brag. Repeat.
Post Reply