diff --git a/interface/src/Application.cpp b/interface/src/Application.cpp index bdefbc6773..f3924f516f 100644 --- a/interface/src/Application.cpp +++ b/interface/src/Application.cpp @@ -591,8 +591,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo _aboutToQuit(false), _notifiedPacketVersionMismatchThisDomain(false), _maxOctreePPS(maxOctreePacketsPerSecond.get()), - _lastFaceTrackerUpdate(0), - _snapshotSound(nullptr) + _lastFaceTrackerUpdate(0)/*, + _snapshotSound(nullptr)*/ { auto steamClient = PluginManager::getInstance()->getSteamClientPlugin(); setProperty(hifi::properties::STEAM, (steamClient && steamClient->isRunning())); @@ -1421,8 +1421,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer& startupTimer, bo return entityServerNode && !isPhysicsEnabled(); }); - QFileInfo inf = QFileInfo(PathUtils::resourcesPath() + "sounds/snap.wav"); - _snapshotSound = DependencyManager::get()->getSound(QUrl::fromLocalFile(inf.absoluteFilePath())); + /*QFileInfo inf = QFileInfo(PathUtils::resourcesPath() + "sounds/snap.wav"); + _snapshotSound = DependencyManager::get()->getSound(QUrl::fromLocalFile(inf.absoluteFilePath()));*/ QVariant testProperty = property(hifi::properties::TEST); qDebug() << testProperty; @@ -1656,9 +1656,9 @@ void Application::cleanupBeforeQuit() { // stop QML DependencyManager::destroy(); - if (_snapshotSoundInjector != nullptr) { + /*if (_snapshotSoundInjector != nullptr) { _snapshotSoundInjector->stop(); - } + }*/ // FIXME: something else is holding a reference to AudioClient, // so it must be explicitly synchronously stopped here @@ -6315,7 +6315,7 @@ void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRa //keep sound thread out of event loop scope - AudioInjectorOptions options; + /*AudioInjectorOptions options; options.localOnly = true; options.stereo = true; @@ -6325,7 +6325,7 @@ void Application::takeSnapshot(bool notify, bool includeAnimated, float aspectRa } else { QByteArray samples = _snapshotSound->getByteArray(); _snapshotSoundInjector = AudioInjector::playSound(samples, options); - } + }*/ postLambdaEvent([notify, includeAnimated, aspectRatio, this] { // Get a screenshot and save it diff --git a/scripts/system/assets/sounds/snap.wav b/scripts/system/assets/sounds/snap.wav index bb562e1db9..e5b86c0c71 100644 Binary files a/scripts/system/assets/sounds/snap.wav and b/scripts/system/assets/sounds/snap.wav differ diff --git a/scripts/system/snapshot.js b/scripts/system/snapshot.js index 494ab245b1..62fbf654c3 100644 --- a/scripts/system/snapshot.js +++ b/scripts/system/snapshot.js @@ -13,7 +13,7 @@ (function() { // BEGIN LOCAL_SCOPE var SNAPSHOT_DELAY = 500; // 500ms -var FINISH_SOUND_DELAY = 350; +var FINISH_SOUND_DELAY = 350; //350ms var resetOverlays; var reticleVisible; var clearOverlayWhenMoving; @@ -410,8 +410,15 @@ function takeSnapshot() { Menu.setIsOptionChecked("Overlays", false); } + var snapActivateSound = SoundCache.getSound(Script.resolvePath("assets/sounds/snap.wav")); + // take snapshot (with no notification) Script.setTimeout(function () { + Audio.playSound(snapActivateSound, { + position: { x: MyAvatar.position.x, y: MyAvatar.position.y, z: MyAvatar.position.z }, + localOnly: true, + volume: 0.2 + }); HMD.closeTablet(); Script.setTimeout(function () { Window.takeSnapshot(false, includeAnimated, 1.91);