mirror of
https://github.com/overte-org/overte.git
synced 2025-04-16 21:02:17 +02:00
parent
e30cf33a03
commit
03d3a535f8
2 changed files with 18 additions and 10 deletions
|
@ -11,6 +11,8 @@
|
|||
//
|
||||
|
||||
var sound = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Animals/mexicanWhipoorwill.raw");
|
||||
var CHANCE_OF_PLAYING_SOUND = 0.01;
|
||||
|
||||
var FACTOR = 0.75;
|
||||
|
||||
var countParticles = 0; // the first time around we want to create the particle and thereafter to modify it.
|
||||
|
@ -23,11 +25,13 @@ function updateParticle() {
|
|||
// move particle three units in front of the avatar
|
||||
var particlePosition = Vec3.sum(MyAvatar.position, Vec3.multiply(avatarFront, 3));
|
||||
|
||||
// play a sound at the location of the particle
|
||||
var options = new AudioInjectionOptions();
|
||||
options.position = particlePosition;
|
||||
options.volume = 0.75;
|
||||
Audio.playSound(sound, options);
|
||||
if (Math.random() < CHANCE_OF_PLAYING_SOUND) {
|
||||
// play a sound at the location of the particle
|
||||
var options = new AudioInjectionOptions();
|
||||
options.position = particlePosition;
|
||||
options.volume = 0.75;
|
||||
Audio.playSound(sound, options);
|
||||
}
|
||||
|
||||
var audioAverageLoudness = MyAvatar.audioAverageLoudness * FACTOR;
|
||||
//print ("Audio Loudness = " + MyAvatar.audioLoudness + " -- Audio Average Loudness = " + MyAvatar.audioAverageLoudness);
|
||||
|
|
|
@ -11,6 +11,8 @@
|
|||
//
|
||||
|
||||
var sound = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/Animals/mexicanWhipoorwill.raw");
|
||||
var CHANCE_OF_PLAYING_SOUND = 0.01;
|
||||
|
||||
var FACTOR = 0.75;
|
||||
|
||||
function addParticle() {
|
||||
|
@ -20,11 +22,13 @@ function addParticle() {
|
|||
// move particle three units in front of the avatar
|
||||
var particlePosition = Vec3.sum(MyAvatar.position, Vec3.multiply (avatarFront, 3));
|
||||
|
||||
// play a sound at the location of the particle
|
||||
var options = new AudioInjectionOptions();
|
||||
options.position = particlePosition;
|
||||
options.volume = 0.25;
|
||||
Audio.playSound(sound, options);
|
||||
if (Math.random() < CHANCE_OF_PLAYING_SOUND) {
|
||||
// play a sound at the location of the particle
|
||||
var options = new AudioInjectionOptions();
|
||||
options.position = particlePosition;
|
||||
options.volume = 0.25;
|
||||
Audio.playSound(sound, options);
|
||||
}
|
||||
|
||||
var audioAverageLoudness = MyAvatar.audioAverageLoudness * FACTOR;
|
||||
//print ("Audio Loudness = " + MyAvatar.audioLoudness + " -- Audio Average Loudness = " + MyAvatar.audioAverageLoudness);
|
||||
|
|
Loading…
Reference in a new issue