content/hifi-public/scripts/acScripts/PlayRecordingOnAC.js
Dale Glass 0d14e5a379 Initial data.
Needs a lot of cleanup. Data has been de-duplicated, and where identical copies existed, one of them
has been replaced with a symlink.

Some files have been excluded, such as binaries, installers and debug dumps. Some of that may still
be present.
2022-02-13 18:59:11 +01:00

48 lines
1.3 KiB
JavaScript

//
// 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 recordingFile = "http://your.recording.url";
var playFromCurrentLocation = true;
var loop = true;
// Set position here if playFromCurrentLocation is true
Avatar.position = { x:1, y: 1, z: 1 };
Avatar.orientation = Quat.fromPitchYawRollDegrees(0, 0, 0);
Avatar.scale = 1.0;
Agent.isAvatar = true;
Recording.loadRecording(recordingFile);
count = 300; // This is necessary to wait for the audio mixer to connect
function update(event) {
if (count > 0) {
count--;
return;
}
if (count == 0) {
Recording.setPlayFromCurrentLocation(playFromCurrentLocation);
Recording.setPlayerLoop(loop);
Recording.setPlayerUseDisplayName(true);
Recording.setPlayerUseAttachments(true);
Recording.setPlayerUseHeadModel(false);
Recording.setPlayerUseSkeletonModel(true);
Recording.startPlaying();
Vec3.print("Playing from ", Avatar.position);
count--;
}
if (!Recording.isPlaying()) {
Script.update.disconnect(update);
}
}
Script.update.connect(update);