|
|
|
This page should outline the internal audio model.
In openBVE, audio is not simply send to the speakers directly. Instead, every sound has a source in 3D world coordinates and a velocity vector, that is, a direction plus the speed the sound source travels at. The listener (the camera) has a similar set of properties, namely a position, a velocity vector and an orientation, which is a direction plus an up vector. The direction is the direction the camera is looking at, while the velocity vector could also point in a different direction. In other words, the listener can look in a different direction than moving to. The up vector simply tells where "up" is, and thus where left and right are.
|  |
The useful property about this system is that every sound has a position, and the listener has a position. This enables fading volume if sounds are far away. For example, if you are in external view, the train could approach and its motor sound and track sound get louder, it will pass near you, then the volume fades away once the train is far away again. As each sound and the listener also have a velocity, doppler effects are produced out-of-the-box.
For openBVE's 3D cabs, this means that sounds like the compressor could be located at a specific position in the train. Say the compressor is somewhere behind you, thus it will be audible from both speakers, then turning the view to the right would let the compressor sound come from the right. Of course this requires new file formats to let developers have full control over the graphics and sounds, but will vastly improve the sensation. If you have a 5.1 system, you would certainly profit from having that in openBVE.
Note:
A 3D positional audio system as presented above inherently requires sound files to be mono, because sounds are dimensionless points in world coordinates. It is not possible to use 3D positional effects with stereo sounds. As such, openBVE will convert stereo sounds to mono and instead relies on its 3D positional system for enabling stereo and surround effects.
Warning: Some stereo sounds used in existing BVE trains have channels which are mutually 180° out of phase. These channels will annihilate each other when converting the sound to mono (destructive interference), thus resulting in no sound at all. See here for a more elaborate explanation. Developers are encouraged to provide mono sounds only in order to avoid this.
Furthermore, only 22050/44100 KHz, 8/16 bit PCM mono wave files are guaranteed to work at the moment, not ADPCM or anything else.
|
Positions of train sounds
This sections explains where sounds of BVE trains are preconfigured to be played relative to the train. This does not apply to openBVE trains, for which it will be possible to define all positions manually.
The following abbreviations are used for positions:
- Center: The sound originates from the center of the car, horizontally centered.
- Front: The sound originates from the front of the car, horizontally centered.
- Cab: The sound originates from the cab. This is at the default view point of the camera when being in interior view.
- Panel: The sound originates from the panel. This is the same as Cab, just around one meter to the front.
- Left: The sound originates from the center of the car, horizontally at the left.
- Right: The sound originates from the center of the car, horizontally at the right.
The following abbreviations are used for radii:
- Car: The sound will be best heard in a radius corresponding to half the car length.
- Panel: The sound will be best heard in a radius of around 2 meters.
| Sound | Position | Radius |
| Adjust.wav | Panel | Panel |
| Air.wav | Center | Car |
| AirZero.wav | Center | Car |
| AirHigh.wav | Center | Car |
| Ats.wav | Cab | Panel |
| AtsCnt.wav | Cab | Panel |
| Brake.wav | Panel | Panel |
| CpEnd.wav | Center | Car |
| CpLoop.wav | Center | Car |
| CpStart.wav | Center | Car |
| Ding.wav | Panel | Panel |
| DoorClsL.wav | Left | Car |
| DoorClsR.wav | Right | Car |
| DoorOpnL.wav | Left | Car |
| DoorOpnR.wav | Right | Car |
| Eb.wav | Cab | Panel |
| EmrBrake.wav | Panel | Panel |
| FlangeN.wav | Front axle of the front car | Car |
| Halt.wav | Cab | Panel |
| Klaxon0.wav | Front | 4 · Car |
| Klaxon1.wav | Front | 4 · Car |
| Klaxon2.wav | Front | Car |
| Leave.wav | Cab | Panel |
| Loop.wav | Center | Car |
| MotorN.wav | Center | Car |
| Point.wav | Front axle of the front car | Car |
| Rub.wav | Front axle of the front car | Car |
| RunN.wav | Center | Car |
| SpringL.wav | Left | Car |
| SpringR.wav | Right | Car |
| ToAtc.wav | Cab | Panel |
| ToAts.wav | Cab | Panel |
Furthermore, station arrival and departure sounds are played at around 5 meters to the sides of the train, depending on whether the doors should open to the left or right, and additionally around 3 meters above the rails. This is intended to correspond to the speakers that are installed on stations.
This is just a default layout for legacy trains. For openBVE trains, developers will be able to specify the positions manually. If you feel that this default layout does not match most of the trains around in the world of BVE, post in the forum to contribute your corrections.
|