mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-13 22:27:13 +02:00
Added in-world test tone JS file
This commit is contained in:
parent
556578b8dc
commit
5bb2c3c62f
1 changed files with 38 additions and 0 deletions
38
examples/inWorldTestTone.js
Normal file
38
examples/inWorldTestTone.js
Normal file
|
@ -0,0 +1,38 @@
|
|||
//
|
||||
// inWorldTestTone.js
|
||||
//
|
||||
//
|
||||
// Created by Philip Rosedale on 5/29/14.
|
||||
// Copyright 2014 High Fidelity, Inc.
|
||||
//
|
||||
// This example script plays a test tone that is useful for debugging audio dropout. 220Hz test tone played at the domain origin.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
var sound = new Sound("https://s3-us-west-1.amazonaws.com/highfidelity-public/sounds/220Sine.wav");
|
||||
|
||||
var soundPlaying = false;
|
||||
|
||||
function update(deltaTime) {
|
||||
if (!Audio.isInjectorPlaying(soundPlaying)) {
|
||||
var options = new AudioInjectionOptions();
|
||||
options.position = { x:0, y:0, z:0 };
|
||||
options.volume = 1.0;
|
||||
options.loop = true;
|
||||
soundPlaying = Audio.playSound(sound, options);
|
||||
print("Started sound loop");
|
||||
}
|
||||
}
|
||||
|
||||
function scriptEnding() {
|
||||
if (Audio.isInjectorPlaying(soundPlaying)) {
|
||||
Audio.stopInjector(soundPlaying);
|
||||
print("Stopped sound loop");
|
||||
}
|
||||
}
|
||||
|
||||
Script.update.connect(update);
|
||||
Script.scriptEnding.connect(scriptEnding);
|
||||
|
Loading…
Reference in a new issue