mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-25 18:55:01 +02:00
Script to play recording on ACs
This commit is contained in:
parent
465b076998
commit
b1ca1e9840
1 changed files with 47 additions and 0 deletions
47
examples/PlayRecordingOnAC.js
Normal file
47
examples/PlayRecordingOnAC.js
Normal file
|
@ -0,0 +1,47 @@
|
|||
//
|
||||
// PlayRecordingOnAC.js
|
||||
// examples
|
||||
//
|
||||
// Created by Clément Brisset on 8/24/14.
|
||||
// Copyright 2014 High Fidelity, Inc.
|
||||
//
|
||||
// Distributed under the Apache License, Version 2.0.
|
||||
// See the accompanying file LICENSE or http://www.apache.org/licenses/LICENSE-2.0.html
|
||||
//
|
||||
|
||||
|
||||
var filename = "http://your.recording.url";
|
||||
var playFromCurrentLocation = true;
|
||||
|
||||
Avatar.faceModelURL = "http://public.highfidelity.io/models/heads/EvilPhilip_v7.fst";
|
||||
Avatar.skeletonModelURL = "http://public.highfidelity.io/models/skeletons/Philip_Carl_Body_A-Pose.fst";
|
||||
|
||||
// Set position here if playFromCurrentLocation is true
|
||||
Avatar.position = { x:1, y: 1, z: 1 };
|
||||
|
||||
Agent.isAvatar = true;
|
||||
|
||||
Avatar.loadRecording(filename);
|
||||
|
||||
count = 300; // This is necessary to wait for the audio mixer to connect
|
||||
function update(event) {
|
||||
if (count > 0) {
|
||||
count--;
|
||||
return;
|
||||
}
|
||||
if (count == 0) {
|
||||
Avatar.startPlaying(playFromCurrentLocation);
|
||||
Avatar.play();
|
||||
Vec3.print("Playing from ", Avatar.position);
|
||||
|
||||
count--;
|
||||
}
|
||||
|
||||
if (Avatar.isPlaying()) {
|
||||
Avatar.play();
|
||||
} else {
|
||||
Script.update.disconnect(update);
|
||||
}
|
||||
}
|
||||
|
||||
Script.update.connect(update);
|
Loading…
Reference in a new issue