From c83f82f5da252c3159cbe58ff1da7af0759bfd97 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Wed, 26 Apr 2017 08:59:50 +1200 Subject: [PATCH] Delay start of recording until after beep finishes --- scripts/system/record.js | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/scripts/system/record.js b/scripts/system/record.js index 9c8a23afb1..77e4eb9c9d 100644 --- a/scripts/system/record.js +++ b/scripts/system/record.js @@ -122,6 +122,7 @@ TICK_SOUND = "assets/sounds/countdown-tick.wav", START_RECORDING_SOUND = "assets/sounds/start-recording.wav", FINISH_RECORDING_SOUND = "assets/sounds/finish-recording.wav", + START_RECORDING_SOUND_DURATION = 1200, SOUND_VOLUME = 0.2; function playSound(sound) { @@ -166,10 +167,13 @@ recordingState = RECORDING; log("Start recording"); playSound(startRecordingSound); - startPosition = MyAvatar.position; - startOrientation = MyAvatar.orientation; - Recording.startRecording(); - RecordingIndicator.show(); + Script.setTimeout(function () { + // Delay start so that start beep is not included in recorded sound. + startPosition = MyAvatar.position; + startOrientation = MyAvatar.orientation; + Recording.startRecording(); + RecordingIndicator.show(); + }, START_RECORDING_SOUND_DURATION); } function finishRecording() {