From 5c8d89fb125de1bba2cb19562e230a2a4c694a0b Mon Sep 17 00:00:00 2001 From: David Rowe Date: Fri, 29 Mar 2019 18:53:30 +1300 Subject: [PATCH 1/6] Fill in and tidy Audio API JSDoc --- interface/src/scripting/Audio.h | 163 ++++++++++-------- .../src/AudioScriptingInterface.h | 42 +++-- .../script-engine/src/ScriptAudioInjector.h | 16 +- 3 files changed, 128 insertions(+), 93 deletions(-) diff --git a/interface/src/scripting/Audio.h b/interface/src/scripting/Audio.h index d6823ea452..cd3f7b1725 100644 --- a/interface/src/scripting/Audio.h +++ b/interface/src/scripting/Audio.h @@ -40,24 +40,40 @@ class Audio : public AudioScriptingInterface, protected ReadWriteLockable { * @hifi-server-entity * @hifi-assignment-client * - * @property {boolean} muted - true if the audio input is muted, otherwise false. + * @property {boolean} muted - true if the audio input is muted for the current user context (desktop or HMD), + * otherwise false. + * @property {boolean} desktopMuted - true if desktop audio input is muted, otherwise false. + * @property {boolean} hmdMuted - true if the HMD input is muted, otherwise false. + * @property {boolean} warnWhenMuted - true if the "muted" warning is enabled, otherwise false. + * When enabled, a "muted" warning is displayed when you try to speak while your microphone is muted. * @property {boolean} noiseReduction - true if noise reduction is enabled, otherwise false. When * enabled, the input audio signal is blocked (fully attenuated) when it falls below an adaptive threshold set just * above the noise floor. - * @property {number} inputLevel - The loudness of the audio input, range 0.0 (no sound) – - * 1.0 (the onset of clipping). Read-only. - * @property {boolean} clipping - true if the audio input is clipping, otherwise false. * @property {number} inputVolume - Adjusts the volume of the input audio; range 0.01.0. * If set to a value, the resulting value depends on the input device: for example, the volume can't be changed on some * devices, and others might only support values of 0.0 and 1.0. - * @property {boolean} isStereoInput - true if the input audio is being used in stereo, otherwise - * false. Some devices do not support stereo, in which case the value is always false. + * @property {number} inputLevel - The loudness of the audio input, range 0.0 (no sound) – + * 1.0 (the onset of clipping). Read-only. + * @property {boolean} clipping - true if the audio input is clipping, otherwise false. * @property {string} context - The current context of the audio: either "Desktop" or "HMD". * Read-only. * @property {object} devices Read-only. Deprecated: This property is deprecated and will be * removed. - * @property {boolean} isSoloing Read-only. true if any nodes are soloed. - * @property {Uuid[]} soloList Read-only. Get the list of currently soloed node UUIDs. + * @property {boolean} pushToTalk - true if push-to-talk is enabled for the current user context (desktop or + * HMD), otherwise false. + * @property {boolean} pushToTalkDesktop - true if desktop push-to-talk is enabled, otherwise + * false. + * @property {boolean} pushToTalkHMD - true if HMD push-to-talk is enabled, otherwise false. + * @property {boolean} pushingToTalk - true if the user is currently pushing to talk, otherwise + * false. + * + * @comment The following properties are from AudioScriptingInterface.h. + * @property {boolean} isStereoInput - true if the input audio is being used in stereo, otherwise + * false. Some devices do not support stereo, in which case the value is always false. + * @property {boolean} isSoloing - true if audio soloing, i.e., playing audio from only specific avatars. + * Read-only. + * @property {Uuid[]} soloList - The list of currently soloed avatar IDs. Empty list if not currently audio soloing. + * Read-only. */ Q_PROPERTY(bool muted READ isMuted WRITE setMuted NOTIFY mutedChanged) @@ -131,7 +147,7 @@ public: Q_INVOKABLE void setOutputDevice(const QAudioDeviceInfo& device, bool isHMD); /**jsdoc - * Enable or disable reverberation. Reverberation is done by the client, on the post-mix audio. The reverberation options + * Enables or disables reverberation. Reverberation is done by the client, on the post-mix audio. The reverberation options * come from either the domain's audio zone if used — configured on the server — or as scripted by * {@link Audio.setReverbOptions|setReverbOptions}. * @function Audio.setReverb @@ -164,69 +180,65 @@ public: Q_INVOKABLE void setReverb(bool enable); /**jsdoc - * Configure reverberation options. Use {@link Audio.setReverb|setReverb} to enable or disable reverberation. + * Configures reverberation options. Use {@link Audio.setReverb|setReverb} to enable or disable reverberation. * @function Audio.setReverbOptions * @param {AudioEffectOptions} options - The reverberation options. */ Q_INVOKABLE void setReverbOptions(const AudioEffectOptions* options); /**jsdoc - * Sets the avatar gain at the server. - * Units are Decibels (dB) + * Sets the volume (gain) that avatar's voices are played at. This gain is used at the server. * @function Audio.setAvatarGain - * @param {number} gain (in dB) - */ + * @param {number} Avatar gain (dB) at the server. + */ Q_INVOKABLE void setAvatarGain(float gain); /**jsdoc - * Gets the avatar gain at the server. + * Gets the volume (gain) that avatar's voices are played at. This gain is used at the server. * @function Audio.getAvatarGain - * @returns {number} gain (in dB) - */ + * @returns {number} Avatar gain (dB) at the server. + */ Q_INVOKABLE float getAvatarGain(); /**jsdoc - * Sets the injector gain at the server. - * Units are Decibels (dB) + * Sets the volume (gain) that the environment is played at, for sounds from the server. * @function Audio.setInjectorGain - * @param {number} gain (in dB) - */ + * @param {number} Injector gain (dB) at the server. + */ Q_INVOKABLE void setInjectorGain(float gain); /**jsdoc - * Gets the injector gain at the server. + * Gets the volume (gain) that the environment is played at, for sounds from the server. * @function Audio.getInjectorGain - * @returns {number} gain (in dB) - */ + * @returns {number} Injector gain (dB) at the server. + */ Q_INVOKABLE float getInjectorGain(); /**jsdoc - * Sets the local injector gain in the client. - * Units are Decibels (dB) + * Sets the volume (gain) that the environment is played at, for sounds from the client. * @function Audio.setLocalInjectorGain - * @param {number} gain (in dB) - */ + * @param {number} Local injector gain (dB) in the client. + */ Q_INVOKABLE void setLocalInjectorGain(float gain); /**jsdoc - * Gets the local injector gain in the client. + * Gets the volume (gain) that the environment is played at, for sounds from the client. * @function Audio.getLocalInjectorGain - * @returns {number} gain (in dB) - */ + * @returns {number} Local injector gain (dB) in the client. + */ Q_INVOKABLE float getLocalInjectorGain(); /**jsdoc - * Sets the injector gain for system sounds. - * Units are Decibels (dB) + * Sets the volume (gain) that system sounds are played at. * @function Audio.setSystemInjectorGain - * @param {number} gain (in dB) - */ + * @param {number} System injector gain (dB) in the client. + */ Q_INVOKABLE void setSystemInjectorGain(float gain); /**jsdoc - * Gets the injector gain for system sounds. + * Gets the volume (gain) that system sounds are played at. * @function Audio.getSystemInjectorGain - * @returns {number} gain (in dB) + * @returns {number} System injector gain (dB) in the client. */ Q_INVOKABLE float getSystemInjectorGain(); @@ -252,13 +264,13 @@ public: Q_INVOKABLE bool startRecording(const QString& filename); /**jsdoc - * Finish making an audio recording started with {@link Audio.startRecording|startRecording}. + * Finishes making an audio recording started with {@link Audio.startRecording|startRecording}. * @function Audio.stopRecording */ Q_INVOKABLE void stopRecording(); /**jsdoc - * Check whether an audio recording is currently being made. + * Checks whether an audio recording is currently being made. * @function Audio.getRecording * @returns {boolean} true if an audio recording is currently being made, otherwise false. */ @@ -274,9 +286,10 @@ signals: void nop(); /**jsdoc - * Triggered when the audio input is muted or unmuted. + * Triggered when the audio input is muted or unmuted for the current context (desktop or HMD). * @function Audio.mutedChanged - * @param {boolean} isMuted - true if the audio input is muted, otherwise false. + * @param {boolean} isMuted - true if the audio input is muted for the current context (desktop or HMD), + * otherwise false. * @returns {Signal} * @example Report when audio input is muted or unmuted * Audio.mutedChanged.connect(function (isMuted) { @@ -286,47 +299,47 @@ signals: void mutedChanged(bool isMuted); /**jsdoc - * Triggered when desktop audio input is muted or unmuted. - * @function Audio.desktopMutedChanged - * @param {boolean} isMuted - true if the audio input is muted for desktop mode, otherwise false. - * @returns {Signal} - */ + * Triggered when desktop audio input is muted or unmuted. + * @function Audio.desktopMutedChanged + * @param {boolean} isMuted - true if desktop audio input is muted, otherwise false. + * @returns {Signal} + */ void desktopMutedChanged(bool isMuted); /**jsdoc - * Triggered when HMD audio input is muted or unmuted. - * @function Audio.hmdMutedChanged - * @param {boolean} isMuted - true if the audio input is muted for HMD mode, otherwise false. - * @returns {Signal} - */ + * Triggered when HMD audio input is muted or unmuted. + * @function Audio.hmdMutedChanged + * @param {boolean} isMuted - true if HMD audio input is muted, otherwise false. + * @returns {Signal} + */ void hmdMutedChanged(bool isMuted); - /** - * Triggered when Push-to-Talk has been enabled or disabled. - * @function Audio.pushToTalkChanged - * @param {boolean} enabled - true if Push-to-Talk is enabled, otherwise false. - * @returns {Signal} - */ + /**jsdoc + * Triggered when push-to-talk is enabled or disabled for the current context (desktop or HMD). + * @function Audio.pushToTalkChanged + * @param {boolean} enabled - true if push-to-talk is enabled, otherwise false. + * @returns {Signal} + */ void pushToTalkChanged(bool enabled); - /** - * Triggered when Push-to-Talk has been enabled or disabled for desktop mode. - * @function Audio.pushToTalkDesktopChanged - * @param {boolean} enabled - true if Push-to-Talk is emabled for Desktop mode, otherwise false. - * @returns {Signal} - */ + /**jsdoc + * Triggered when push-to-talk is enabled or disabled for desktop mode. + * @function Audio.pushToTalkDesktopChanged + * @param {boolean} enabled - true if push-to-talk is enabled for desktop mode, otherwise false. + * @returns {Signal} + */ void pushToTalkDesktopChanged(bool enabled); - /** - * Triggered when Push-to-Talk has been enabled or disabled for HMD mode. - * @function Audio.pushToTalkHMDChanged - * @param {boolean} enabled - true if Push-to-Talk is emabled for HMD mode, otherwise false. - * @returns {Signal} - */ + /**jsdoc + * Triggered when push-to-talk is enabled or disabled for HMD mode. + * @function Audio.pushToTalkHMDChanged + * @param {boolean} enabled - true if push-to-talk is enabled for HMD mode, otherwise false. + * @returns {Signal} + */ void pushToTalkHMDChanged(bool enabled); /**jsdoc - * Triggered when the audio input noise reduction is enabled or disabled. + * Triggered when audio input noise reduction is enabled or disabled. * @function Audio.noiseReductionChanged * @param {boolean} isEnabled - true if audio input noise reduction is enabled, otherwise false. * @returns {Signal} @@ -378,11 +391,11 @@ signals: void contextChanged(const QString& context); /**jsdoc - * Triggered when pushing to talk. - * @function Audio.pushingToTalkChanged - * @param {boolean} talking - true if broadcasting with PTT, false otherwise. - * @returns {Signal} - */ + * Triggered when push-to-talk changes. + * @function Audio.pushingToTalkChanged + * @param {boolean} talking - true if started pushing to talk, false if stopped pushing to talk. + * @returns {Signal} + */ void pushingToTalkChanged(bool talking); public slots: diff --git a/libraries/script-engine/src/AudioScriptingInterface.h b/libraries/script-engine/src/AudioScriptingInterface.h index a6801dcdcb..4b19b719e2 100644 --- a/libraries/script-engine/src/AudioScriptingInterface.h +++ b/libraries/script-engine/src/AudioScriptingInterface.h @@ -41,25 +41,27 @@ public: } /**jsdoc - * Add nodes to the audio solo list + * Adds avatar to the audio solo list. If the audio solo list is non-empty, only audio from the avatars in the list is + * played. * @function Audio.addToSoloList - * @param {Uuid[]} uuidList - List of node UUIDs to add to the solo list. + * @param {Uuid[]} ids - Avatar IDs to add to the solo list. */ Q_INVOKABLE void addToSoloList(QVector uuidList) { _localAudioInterface->getAudioSolo().addUUIDs(uuidList); } /**jsdoc - * Remove nodes from the audio solo list + * Removes avatars from the audio solo list. If the audio solo list is non-empty, only audio from the avatars in the list + * is played. * @function Audio.removeFromSoloList - * @param {Uuid[]} uuidList - List of node UUIDs to remove from the solo list. + * @param {Uuid[]} ids - Avatar IDs to remove from the solo list. */ Q_INVOKABLE void removeFromSoloList(QVector uuidList) { _localAudioInterface->getAudioSolo().removeUUIDs(uuidList); } /**jsdoc - * Reset the list of soloed nodes. + * Clears the audio solo list. * @function Audio.resetSoloList */ Q_INVOKABLE void resetSoloList() { @@ -67,33 +69,51 @@ public: } /**jsdoc + * Gets whether echoing microphone audio back to your from the server is enabled. When enabled, microphone audio is echoed + * only if you're unmuted or are pushing-to-talk. * @function Audio.getServerEcho + * @returns {boolean} true if echoing microphone audio back to you from the server is enabled, + * false if it isn't. */ Q_INVOKABLE bool getServerEcho(); /**jsdoc + * Sets whether echoiing microphone audio back to your from the server is enabled. When enabled, microphone audio is echoed + * only if you're unmuted or are pushing-to-talk. * @function Audio.setServerEcho - * @parm {boolean} serverEcho + * @parm {boolean} serverEcho - true to enable echoing microphone back to you from the server, + * false to disable. */ Q_INVOKABLE void setServerEcho(bool serverEcho); /**jsdoc + * Toggles the echoing of microphone audio back to you from the server. When enabled, microphone audio is echoed only if + * you're unmuted or are pushing-to-talk. * @function Audio.toggleServerEcho */ Q_INVOKABLE void toggleServerEcho(); /**jsdoc + * Gets whether echoing microphone audio back to your by the client is enabled. When enabled, microphone audio is even if + * you're muted or not pushing-to-talk. * @function Audio.getLocalEcho + * @returns {boolean} true if echoing microphone audio back to you from the client is enabled, + * false if it isn't. */ Q_INVOKABLE bool getLocalEcho(); /**jsdoc + * Sets whether echoing microphone audio back to your by the client is enabled. When enabled, microphone audio is even if + * you're muted or not pushing-to-talk. * @function Audio.setLocalEcho - * @parm {boolean} localEcho + * @parm {boolean} localEcho - true to enable echoing microphone audio back to you from the client, + * false to disable. */ Q_INVOKABLE void setLocalEcho(bool localEcho); /**jsdoc + * Toggles the echoing of microphone audio back to you from the client. When enabled, microphone audio is echoed even if + * you're muted or not pushing-to-talk. * @function Audio.toggleLocalEcho */ Q_INVOKABLE void toggleLocalEcho(); @@ -129,7 +149,7 @@ protected: Q_INVOKABLE ScriptAudioInjector* playSound(SharedSoundPointer sound, const AudioInjectorOptions& injectorOptions = AudioInjectorOptions()); /**jsdoc - * Start playing the content of an audio file, locally (isn't sent to the audio mixer). This is the same as calling + * Starts playing the content of an audio file, locally (isn't sent to the audio mixer). This is the same as calling * {@link Audio.playSound} with {@link AudioInjector.AudioInjectorOptions} localOnly set true and * the specified position. * @function Audio.playSystemSound @@ -140,15 +160,15 @@ protected: Q_INVOKABLE ScriptAudioInjector* playSystemSound(SharedSoundPointer sound); /**jsdoc - * Set whether or not the audio input should be used in stereo. If the audio input does not support stereo then setting a - * value of true has no effect. + * Sets whether the audio input should be used in stereo. If the audio input doesn't support stereo then setting a value + * of true has no effect. * @function Audio.setStereoInput * @param {boolean} stereo - true if the audio input should be used in stereo, otherwise false. */ Q_INVOKABLE void setStereoInput(bool stereo); /**jsdoc - * Get whether or not the audio input is used in stereo. + * Gets whether the audio input is used in stereo. * @function Audio.isStereoInput * @returns {boolean} true if the audio input is used in stereo, otherwise false. */ diff --git a/libraries/script-engine/src/ScriptAudioInjector.h b/libraries/script-engine/src/ScriptAudioInjector.h index d77291b92c..a67c15bace 100644 --- a/libraries/script-engine/src/ScriptAudioInjector.h +++ b/libraries/script-engine/src/ScriptAudioInjector.h @@ -17,7 +17,9 @@ #include /**jsdoc - * Plays — "injects" — the content of an audio file. Used in the {@link Audio} API. + * Plays — "injects" — the content of an audio file. + * + *

Create using {@link Audio} API methods.

* * @class AudioInjector * @@ -45,13 +47,13 @@ public: public slots: /**jsdoc - * Stop current playback, if any, and start playing from the beginning. + * Stops current playback, if any, and start playing from the beginning. * @function AudioInjector.restart */ void restart() { DependencyManager::get()->restart(_injector); } /**jsdoc - * Stop audio playback. + * Stops audio playback. * @function AudioInjector.stop * @example Stop playing a sound before it finishes. * var sound = SoundCache.getSound(Script.resourcesPath() + "sounds/sample.wav"); @@ -71,28 +73,28 @@ public slots: void stop() { DependencyManager::get()->stop(_injector); } /**jsdoc - * Get the current configuration of the audio injector. + * Gets the current configuration of the audio injector. * @function AudioInjector.getOptions * @returns {AudioInjector.AudioInjectorOptions} Configuration of how the injector plays the audio. */ AudioInjectorOptions getOptions() const { return DependencyManager::get()->getOptions(_injector); } /**jsdoc - * Configure how the injector plays the audio. + * Configures how the injector plays the audio. * @function AudioInjector.setOptions * @param {AudioInjector.AudioInjectorOptions} options - Configuration of how the injector plays the audio. */ void setOptions(const AudioInjectorOptions& options) { DependencyManager::get()->setOptions(_injector, options); } /**jsdoc - * Get the loudness of the most recent frame of audio played. + * Gets the loudness of the most recent frame of audio played. * @function AudioInjector.getLoudness * @returns {number} The loudness of the most recent frame of audio played, range 0.01.0. */ float getLoudness() const { return DependencyManager::get()->getLoudness(_injector); } /**jsdoc - * Get whether or not the audio is currently playing. + * Gets whether or not the audio is currently playing. * @function AudioInjector.isPlaying * @returns {boolean} true if the audio is currently playing, otherwise false. * @example See if a sound is playing. From da45b4db38f3d6f9bb8cffc38c8f5103528c9f8f Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 30 Mar 2019 09:51:02 +1300 Subject: [PATCH 2/6] Add further Audio API examples --- interface/src/scripting/Audio.h | 14 ++++++++ .../src/AudioScriptingInterface.h | 32 +++++++++++++++++++ 2 files changed, 46 insertions(+) diff --git a/interface/src/scripting/Audio.h b/interface/src/scripting/Audio.h index cd3f7b1725..3e6cd451c0 100644 --- a/interface/src/scripting/Audio.h +++ b/interface/src/scripting/Audio.h @@ -197,6 +197,12 @@ public: * Gets the volume (gain) that avatar's voices are played at. This gain is used at the server. * @function Audio.getAvatarGain * @returns {number} Avatar gain (dB) at the server. + * @example Report current audio gain settings. + * // 0 value = normal volume; -ve value = quieter; +ve value = louder. + * print("Avatar gain: " + Audio.getAvatarGain()); + * print("Environment server gain: " + Audio.getInjectorGain()); + * print("Environment local gain: " + Audio.getLocalInjectorGain()); + * print("System gain: " + Audio.getSystemInjectorGain()); */ Q_INVOKABLE float getAvatarGain(); @@ -303,6 +309,10 @@ signals: * @function Audio.desktopMutedChanged * @param {boolean} isMuted - true if desktop audio input is muted, otherwise false. * @returns {Signal} + * @example Report when desktop muting changes. + * Audio.desktopMutedChanged.connect(function (desktopMuted) { + * print("Desktop muted: " + desktopMuted); + * }); */ void desktopMutedChanged(bool isMuted); @@ -319,6 +329,10 @@ signals: * @function Audio.pushToTalkChanged * @param {boolean} enabled - true if push-to-talk is enabled, otherwise false. * @returns {Signal} + * @example Report when push-to-talk changes. + * Audio.pushToTalkChanged.connect(function (enabled) { + * print("Push to talk: " + (enabled ? "on" : "off")); + * }); */ void pushToTalkChanged(bool enabled); diff --git a/libraries/script-engine/src/AudioScriptingInterface.h b/libraries/script-engine/src/AudioScriptingInterface.h index 4b19b719e2..94fcfe19ec 100644 --- a/libraries/script-engine/src/AudioScriptingInterface.h +++ b/libraries/script-engine/src/AudioScriptingInterface.h @@ -45,6 +45,33 @@ public: * played. * @function Audio.addToSoloList * @param {Uuid[]} ids - Avatar IDs to add to the solo list. + + * @example Listen to a single nearby avatar for a short while. + * // Find nearby avatars. + * var RANGE = 100; // m + * var nearbyAvatars = AvatarList.getAvatarsInRange(MyAvatar.position, RANGE); + * + * // Remove own avatar from list. + * var myAvatarIndex = nearbyAvatars.indexOf(MyAvatar.sessionUUID); + * if (myAvatarIndex !== -1) { + * nearbyAvatars.splice(myAvatarIndex, 1); + * } + * + * if (nearbyAvatars.length > 0) { + * // Listen to only one of the nearby avatars. + * var avatarName = AvatarList.getAvatar(nearbyAvatars[0]).displayName; + * print("Listening only to " + avatarName); + * Audio.addToSoloList([nearbyAvatars[0]]); + * + * // Stop listening to only the one avatar after a short while. + * Script.setTimeout(function () { + * print("Finished listening only to " + avatarName); + * Audio.resetSoloList(); + * }, 10000); // 10s + * + * } else { + * print("No nearby avatars"); + * } */ Q_INVOKABLE void addToSoloList(QVector uuidList) { _localAudioInterface->getAudioSolo().addUUIDs(uuidList); @@ -108,6 +135,11 @@ public: * @function Audio.setLocalEcho * @parm {boolean} localEcho - true to enable echoing microphone audio back to you from the client, * false to disable. + * @example Echo local audio for a few seconds. + * Audio.setLocalEcho(true); + * Script.setTimeout(function () { + * Audio.setLocalEcho(false); + * }, 3000); // 3s */ Q_INVOKABLE void setLocalEcho(bool localEcho); From dff013128e05f99ee1f04cdfc196319c97a1ae8a Mon Sep 17 00:00:00 2001 From: David Rowe Date: Sat, 30 Mar 2019 10:09:48 +1300 Subject: [PATCH 3/6] Text improvements and typos --- interface/src/scripting/Audio.h | 22 +++++++++---------- .../src/AudioScriptingInterface.h | 14 ++++++------ 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/interface/src/scripting/Audio.h b/interface/src/scripting/Audio.h index 3e6cd451c0..c594f4891f 100644 --- a/interface/src/scripting/Audio.h +++ b/interface/src/scripting/Audio.h @@ -70,8 +70,8 @@ class Audio : public AudioScriptingInterface, protected ReadWriteLockable { * @comment The following properties are from AudioScriptingInterface.h. * @property {boolean} isStereoInput - true if the input audio is being used in stereo, otherwise * false. Some devices do not support stereo, in which case the value is always false. - * @property {boolean} isSoloing - true if audio soloing, i.e., playing audio from only specific avatars. - * Read-only. + * @property {boolean} isSoloing - true if currently audio soloing, i.e., playing audio from only specific + * avatars. Read-only. * @property {Uuid[]} soloList - The list of currently soloed avatar IDs. Empty list if not currently audio soloing. * Read-only. */ @@ -187,14 +187,14 @@ public: Q_INVOKABLE void setReverbOptions(const AudioEffectOptions* options); /**jsdoc - * Sets the volume (gain) that avatar's voices are played at. This gain is used at the server. + * Sets the gain (relative volume) that avatars' voices are played at. This gain is used at the server. * @function Audio.setAvatarGain * @param {number} Avatar gain (dB) at the server. */ Q_INVOKABLE void setAvatarGain(float gain); /**jsdoc - * Gets the volume (gain) that avatar's voices are played at. This gain is used at the server. + * Gets the gain (relative volume) that avatars' voices are played at. This gain is used at the server. * @function Audio.getAvatarGain * @returns {number} Avatar gain (dB) at the server. * @example Report current audio gain settings. @@ -207,42 +207,42 @@ public: Q_INVOKABLE float getAvatarGain(); /**jsdoc - * Sets the volume (gain) that the environment is played at, for sounds from the server. + * Sets the gain (relative volume) that the environment is played at, for sounds from the server. * @function Audio.setInjectorGain * @param {number} Injector gain (dB) at the server. */ Q_INVOKABLE void setInjectorGain(float gain); /**jsdoc - * Gets the volume (gain) that the environment is played at, for sounds from the server. + * Gets the gain (relative volume) that the environment is played at, for sounds from the server. * @function Audio.getInjectorGain * @returns {number} Injector gain (dB) at the server. */ Q_INVOKABLE float getInjectorGain(); /**jsdoc - * Sets the volume (gain) that the environment is played at, for sounds from the client. + * Sets the gain (relative volume) that the environment is played at, for sounds from the client. * @function Audio.setLocalInjectorGain * @param {number} Local injector gain (dB) in the client. */ Q_INVOKABLE void setLocalInjectorGain(float gain); /**jsdoc - * Gets the volume (gain) that the environment is played at, for sounds from the client. + * Gets the gain (relative volume) that the environment is played at, for sounds from the client. * @function Audio.getLocalInjectorGain * @returns {number} Local injector gain (dB) in the client. */ Q_INVOKABLE float getLocalInjectorGain(); /**jsdoc - * Sets the volume (gain) that system sounds are played at. + * Sets the gain (relative volume) that system sounds are played at. * @function Audio.setSystemInjectorGain * @param {number} System injector gain (dB) in the client. */ Q_INVOKABLE void setSystemInjectorGain(float gain); /**jsdoc - * Gets the volume (gain) that system sounds are played at. + * Gets the gain (relative volume) that system sounds are played at. * @function Audio.getSystemInjectorGain * @returns {number} System injector gain (dB) in the client. */ @@ -405,7 +405,7 @@ signals: void contextChanged(const QString& context); /**jsdoc - * Triggered when push-to-talk changes. + * Triggered when pushing-to-talk changes. * @function Audio.pushingToTalkChanged * @param {boolean} talking - true if started pushing to talk, false if stopped pushing to talk. * @returns {Signal} diff --git a/libraries/script-engine/src/AudioScriptingInterface.h b/libraries/script-engine/src/AudioScriptingInterface.h index 94fcfe19ec..a98666681a 100644 --- a/libraries/script-engine/src/AudioScriptingInterface.h +++ b/libraries/script-engine/src/AudioScriptingInterface.h @@ -41,7 +41,7 @@ public: } /**jsdoc - * Adds avatar to the audio solo list. If the audio solo list is non-empty, only audio from the avatars in the list is + * Adds avatars to the audio solo list. If the audio solo list is non-empty, only audio from the avatars in the list is * played. * @function Audio.addToSoloList * @param {Uuid[]} ids - Avatar IDs to add to the solo list. @@ -96,7 +96,7 @@ public: } /**jsdoc - * Gets whether echoing microphone audio back to your from the server is enabled. When enabled, microphone audio is echoed + * Gets whether echoing microphone audio back to you from the server is enabled. When enabled, microphone audio is echoed * only if you're unmuted or are pushing-to-talk. * @function Audio.getServerEcho * @returns {boolean} true if echoing microphone audio back to you from the server is enabled, @@ -105,7 +105,7 @@ public: Q_INVOKABLE bool getServerEcho(); /**jsdoc - * Sets whether echoiing microphone audio back to your from the server is enabled. When enabled, microphone audio is echoed + * Sets whether echoing microphone audio back to you from the server is enabled. When enabled, microphone audio is echoed * only if you're unmuted or are pushing-to-talk. * @function Audio.setServerEcho * @parm {boolean} serverEcho - true to enable echoing microphone back to you from the server, @@ -121,8 +121,8 @@ public: Q_INVOKABLE void toggleServerEcho(); /**jsdoc - * Gets whether echoing microphone audio back to your by the client is enabled. When enabled, microphone audio is even if - * you're muted or not pushing-to-talk. + * Gets whether echoing microphone audio back to you by the client is enabled. When enabled, microphone audio is echoed + * even if you're muted or not pushing-to-talk. * @function Audio.getLocalEcho * @returns {boolean} true if echoing microphone audio back to you from the client is enabled, * false if it isn't. @@ -130,8 +130,8 @@ public: Q_INVOKABLE bool getLocalEcho(); /**jsdoc - * Sets whether echoing microphone audio back to your by the client is enabled. When enabled, microphone audio is even if - * you're muted or not pushing-to-talk. + * Sets whether echoing microphone audio back to you by the client is enabled. When enabled, microphone audio is echoed + * even if you're muted or not pushing-to-talk. * @function Audio.setLocalEcho * @parm {boolean} localEcho - true to enable echoing microphone audio back to you from the client, * false to disable. From a6ae79a2d811caf4c5990a41e943c3f56e4a4c2f Mon Sep 17 00:00:00 2001 From: David Rowe Date: Thu, 4 Apr 2019 11:34:10 +1300 Subject: [PATCH 4/6] Misc. fixes. --- interface/src/scripting/Audio.h | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/interface/src/scripting/Audio.h b/interface/src/scripting/Audio.h index bbafac95a3..b66c228bf2 100644 --- a/interface/src/scripting/Audio.h +++ b/interface/src/scripting/Audio.h @@ -132,16 +132,16 @@ public: /**jsdoc * @function Audio.setInputDevice - * @param {object} device - * @param {boolean} isHMD + * @param {object} device - Device. + * @param {boolean} isHMD - Is HMD. * @deprecated This function is deprecated and will be removed. */ Q_INVOKABLE void setInputDevice(const QAudioDeviceInfo& device, bool isHMD); /**jsdoc * @function Audio.setOutputDevice - * @param {object} device - * @param {boolean} isHMD + * @param {object} device - Device. + * @param {boolean} isHMD - Is HMD. * @deprecated This function is deprecated and will be removed. */ Q_INVOKABLE void setOutputDevice(const QAudioDeviceInfo& device, bool isHMD); From 6e09c4885f916b00a69f815142ac65452ad0743f Mon Sep 17 00:00:00 2001 From: David Rowe Date: Tue, 23 Apr 2019 14:35:25 +1200 Subject: [PATCH 5/6] Review updates --- interface/src/scripting/Audio.h | 36 ++++++++-------- libraries/audio/src/AudioInjectorOptions.cpp | 10 +++-- libraries/audio/src/Sound.h | 2 +- .../src/AudioScriptingInterface.h | 41 ++++++++++--------- .../script-engine/src/ScriptAudioInjector.h | 4 +- 5 files changed, 48 insertions(+), 45 deletions(-) diff --git a/interface/src/scripting/Audio.h b/interface/src/scripting/Audio.h index b66c228bf2..825393408e 100644 --- a/interface/src/scripting/Audio.h +++ b/interface/src/scripting/Audio.h @@ -45,12 +45,12 @@ class Audio : public AudioScriptingInterface, protected ReadWriteLockable { * @property {boolean} mutedDesktop - true if desktop audio input is muted, otherwise false. * @property {boolean} mutedHMD - true if the HMD input is muted, otherwise false. * @property {boolean} warnWhenMuted - true if the "muted" warning is enabled, otherwise false. - * When enabled, a "muted" warning is displayed when you try to speak while your microphone is muted. + * When enabled, if you speak while your microphone is muted, "muted" is displayed on the screen as a warning. * @property {boolean} noiseReduction - true if noise reduction is enabled, otherwise false. When * enabled, the input audio signal is blocked (fully attenuated) when it falls below an adaptive threshold set just * above the noise floor. - * @property {number} inputVolume - Adjusts the volume of the input audio; range 0.01.0. - * If set to a value, the resulting value depends on the input device: for example, the volume can't be changed on some + * @property {number} inputVolume - Adjusts the volume of the input audio, range 0.01.0. + * If set to a value, the resulting value depends on the input device: for example, the volume can't be changed on some * devices, and others might only support values of 0.0 and 1.0. * @property {number} inputLevel - The loudness of the audio input, range 0.0 (no sound) – * 1.0 (the onset of clipping). Read-only. @@ -64,7 +64,7 @@ class Audio : public AudioScriptingInterface, protected ReadWriteLockable { * @property {boolean} pushToTalkDesktop - true if desktop push-to-talk is enabled, otherwise * false. * @property {boolean} pushToTalkHMD - true if HMD push-to-talk is enabled, otherwise false. - * @property {boolean} pushingToTalk - true if the user is currently pushing to talk, otherwise + * @property {boolean} pushingToTalk - true if the user is currently pushing-to-talk, otherwise * false. * * @comment The following properties are from AudioScriptingInterface.h. @@ -147,8 +147,8 @@ public: Q_INVOKABLE void setOutputDevice(const QAudioDeviceInfo& device, bool isHMD); /**jsdoc - * Enables or disables reverberation. Reverberation is done by the client, on the post-mix audio. The reverberation options - * come from either the domain's audio zone if used — configured on the server — or as scripted by + * Enables or disables reverberation. Reverberation is done by the client on the post-mix audio. The reverberation options + * come from either the domain's audio zone configured on the server or settings scripted by * {@link Audio.setReverbOptions|setReverbOptions}. * @function Audio.setReverb * @param {boolean} enable - true to enable reverberation, false to disable. @@ -207,44 +207,44 @@ public: Q_INVOKABLE float getAvatarGain(); /**jsdoc - * Sets the gain (relative volume) that the environment is played at, for sounds from the server. + * Sets the gain (relative volume) that environment sounds from the server are played at. * @function Audio.setInjectorGain * @param {number} Injector gain (dB) at the server. */ Q_INVOKABLE void setInjectorGain(float gain); /**jsdoc - * Gets the gain (relative volume) that the environment is played at, for sounds from the server. + * Gets the gain (relative volume) that environment sounds from the server are played at. * @function Audio.getInjectorGain * @returns {number} Injector gain (dB) at the server. */ Q_INVOKABLE float getInjectorGain(); /**jsdoc - * Sets the gain (relative volume) that the environment is played at, for sounds from the client. + * Sets the gain (relative volume) that environment sounds from the client are played at. * @function Audio.setLocalInjectorGain - * @param {number} Local injector gain (dB) in the client. + * @param {number} Injector gain (dB) in the client. */ Q_INVOKABLE void setLocalInjectorGain(float gain); /**jsdoc - * Gets the gain (relative volume) that the environment is played at, for sounds from the client. + * Gets the gain (relative volume) that environment sounds from the client are played at. * @function Audio.getLocalInjectorGain - * @returns {number} Local injector gain (dB) in the client. + * @returns {number} Injector gain (dB) in the client. */ Q_INVOKABLE float getLocalInjectorGain(); /**jsdoc * Sets the gain (relative volume) that system sounds are played at. * @function Audio.setSystemInjectorGain - * @param {number} System injector gain (dB) in the client. + * @param {number} Injector gain (dB) in the client. */ Q_INVOKABLE void setSystemInjectorGain(float gain); /**jsdoc * Gets the gain (relative volume) that system sounds are played at. * @function Audio.getSystemInjectorGain - * @returns {number} System injector gain (dB) in the client. + * @returns {number} Injector gain (dB) in the client. */ Q_INVOKABLE float getSystemInjectorGain(); @@ -372,8 +372,8 @@ signals: * Triggered when the input audio volume changes. * @function Audio.inputVolumeChanged * @param {number} volume - The requested volume to be applied to the audio input, range 0.0 – - * 1.0. The resulting value of Audio.inputVolume depends on the capabilities of the device: - * for example, the volume can't be changed on some devices, and others might only support values of 0.0 + * 1.0. The resulting value of Audio.inputVolume depends on the capabilities of the device. + * For example, the volume can't be changed on some devices, while others might only support values of 0.0 * and 1.0. * @returns {Signal} */ @@ -405,9 +405,9 @@ signals: void contextChanged(const QString& context); /**jsdoc - * Triggered when pushing-to-talk changes. + * Triggered when the user starts or stops push-to-talk. * @function Audio.pushingToTalkChanged - * @param {boolean} talking - true if started pushing to talk, false if stopped pushing to talk. + * @param {boolean} talking - true if started push-to-talk, false if stopped push-to-talk. * @returns {Signal} */ void pushingToTalkChanged(bool talking); diff --git a/libraries/audio/src/AudioInjectorOptions.cpp b/libraries/audio/src/AudioInjectorOptions.cpp index 0946841fc6..ee6b960e9f 100644 --- a/libraries/audio/src/AudioInjectorOptions.cpp +++ b/libraries/audio/src/AudioInjectorOptions.cpp @@ -48,18 +48,20 @@ QScriptValue injectorOptionsToScriptValue(QScriptEngine* engine, const AudioInje } /**jsdoc - * Configures how an audio injector plays its audio. + * Configures where and how an audio injector plays its audio. * @typedef {object} AudioInjector.AudioInjectorOptions * @property {Vec3} position=Vec3.ZERO - The position in the domain to play the sound. * @property {Quat} orientation=Quat.IDENTITY - The orientation in the domain to play the sound in. * @property {number} volume=1.0 - Playback volume, between 0.0 and 1.0. * @property {number} pitch=1.0 - Alter the pitch of the sound, within +/- 2 octaves. The value is the relative sample rate to - * resample the sound at, range 0.062516.0. A value of 0.0625 lowers the - * pitch by 2 octaves; 1.0 is no change in pitch; 16.0 raises the pitch by 2 octaves. + * resample the sound at, range 0.062516.0.
+ * A value of 0.0625 lowers the pitch by 2 octaves.
+ * A value of 1.0 means there is no change in pitch.
+ * A value of 16.0 raises the pitch by 2 octaves. * @property {boolean} loop=false - If true, the sound is played repeatedly until playback is stopped. * @property {number} secondOffset=0 - Starts playback from a specified time (seconds) within the sound file, ≥ * 0. - * @property {boolean} localOnly=false - IF true, the sound is played back locally on the client rather than to + * @property {boolean} localOnly=false - If true, the sound is played back locally on the client rather than to * others via the audio mixer. * @property {boolean} ignorePenumbra=false - Deprecated: This property is deprecated and will be * removed. diff --git a/libraries/audio/src/Sound.h b/libraries/audio/src/Sound.h index f5f47add32..a5a48b836c 100644 --- a/libraries/audio/src/Sound.h +++ b/libraries/audio/src/Sound.h @@ -124,7 +124,7 @@ typedef QSharedPointer SharedSoundPointer; * An audio resource, created by {@link SoundCache.getSound}, to be played back using {@link Audio.playSound}. *

Supported formats:

*
    - *
  • WAV: 16-bit uncompressed WAV at any sample rate, with 1 (mono), 2(stereo), or 4 (ambisonic) channels.
  • + *
  • WAV: 16-bit uncompressed at any sample rate, with 1 (mono), 2(stereo), or 4 (ambisonic) channels.
  • *
  • MP3: Mono or stereo, at any sample rate.
  • *
  • RAW: 48khz 16-bit mono or stereo. Filename must include ".stereo" to be interpreted as stereo.
  • *
diff --git a/libraries/script-engine/src/AudioScriptingInterface.h b/libraries/script-engine/src/AudioScriptingInterface.h index a98666681a..34958181a9 100644 --- a/libraries/script-engine/src/AudioScriptingInterface.h +++ b/libraries/script-engine/src/AudioScriptingInterface.h @@ -41,7 +41,7 @@ public: } /**jsdoc - * Adds avatars to the audio solo list. If the audio solo list is non-empty, only audio from the avatars in the list is + * Adds avatars to the audio solo list. If the audio solo list is not empty, only audio from the avatars in the list is * played. * @function Audio.addToSoloList * @param {Uuid[]} ids - Avatar IDs to add to the solo list. @@ -78,7 +78,7 @@ public: } /**jsdoc - * Removes avatars from the audio solo list. If the audio solo list is non-empty, only audio from the avatars in the list + * Removes avatars from the audio solo list. If the audio solo list is not empty, only audio from the avatars in the list * is played. * @function Audio.removeFromSoloList * @param {Uuid[]} ids - Avatar IDs to remove from the solo list. @@ -96,8 +96,8 @@ public: } /**jsdoc - * Gets whether echoing microphone audio back to you from the server is enabled. When enabled, microphone audio is echoed - * only if you're unmuted or are pushing-to-talk. + * Gets whether your microphone audio is echoed back to you from the server. When enabled, microphone audio is echoed only + * if you're unmuted or are using push-to-talk. * @function Audio.getServerEcho * @returns {boolean} true if echoing microphone audio back to you from the server is enabled, * false if it isn't. @@ -105,8 +105,8 @@ public: Q_INVOKABLE bool getServerEcho(); /**jsdoc - * Sets whether echoing microphone audio back to you from the server is enabled. When enabled, microphone audio is echoed - * only if you're unmuted or are pushing-to-talk. + * Sets whether your microphone audio is echoed back to you from the server. When enabled, microphone audio is echoed + * only if you're unmuted or are using push-to-talk. * @function Audio.setServerEcho * @parm {boolean} serverEcho - true to enable echoing microphone back to you from the server, * false to disable. @@ -115,14 +115,14 @@ public: /**jsdoc * Toggles the echoing of microphone audio back to you from the server. When enabled, microphone audio is echoed only if - * you're unmuted or are pushing-to-talk. + * you're unmuted or are using push-to-talk. * @function Audio.toggleServerEcho */ Q_INVOKABLE void toggleServerEcho(); /**jsdoc - * Gets whether echoing microphone audio back to you by the client is enabled. When enabled, microphone audio is echoed - * even if you're muted or not pushing-to-talk. + * Gets whether your microphone audio is echoed back to you by the client. When enabled, microphone audio is echoed + * even if you're muted or not using push-to-talk. * @function Audio.getLocalEcho * @returns {boolean} true if echoing microphone audio back to you from the client is enabled, * false if it isn't. @@ -130,8 +130,8 @@ public: Q_INVOKABLE bool getLocalEcho(); /**jsdoc - * Sets whether echoing microphone audio back to you by the client is enabled. When enabled, microphone audio is echoed - * even if you're muted or not pushing-to-talk. + * Sets whether your microphone audio is echoed back to you by the client. When enabled, microphone audio is echoed + * even if you're muted or not using push-to-talk. * @function Audio.setLocalEcho * @parm {boolean} localEcho - true to enable echoing microphone audio back to you from the client, * false to disable. @@ -144,8 +144,8 @@ public: Q_INVOKABLE void setLocalEcho(bool localEcho); /**jsdoc - * Toggles the echoing of microphone audio back to you from the client. When enabled, microphone audio is echoed even if - * you're muted or not pushing-to-talk. + * Toggles the echoing of microphone audio back to you by the client. When enabled, microphone audio is echoed even if + * you're muted or not using push-to-talk. * @function Audio.toggleLocalEcho */ Q_INVOKABLE void toggleLocalEcho(); @@ -157,7 +157,7 @@ protected: // these methods are protected to stop C++ callers from calling, but invokable from script /**jsdoc - * Starts playing — "injecting" — the content of an audio file. The sound is played globally (sent to the audio + * Starts playing or "injecting" the content of an audio file. The sound is played globally (sent to the audio * mixer) so that everyone hears it, unless the injectorOptions has localOnly set to * true in which case only the client hears the sound played. No sound is played if sent to the audio mixer * but the client is not connected to an audio mixer. The {@link AudioInjector} object returned by the function can be used @@ -165,7 +165,8 @@ protected: * @function Audio.playSound * @param {SoundObject} sound - The content of an audio file, loaded using {@link SoundCache.getSound}. See * {@link SoundObject} for supported formats. - * @param {AudioInjector.AudioInjectorOptions} [injectorOptions={}] - Audio injector configuration. + * @param {AudioInjector.AudioInjectorOptions} [injectorOptions={}] - Configures where and how the audio injector plays the + * audio file. * @returns {AudioInjector} The audio injector that plays the audio file. * @example Play a sound. * var sound = SoundCache.getSound(Script.resourcesPath() + "sounds/sample.wav"); @@ -181,11 +182,11 @@ protected: Q_INVOKABLE ScriptAudioInjector* playSound(SharedSoundPointer sound, const AudioInjectorOptions& injectorOptions = AudioInjectorOptions()); /**jsdoc - * Starts playing the content of an audio file, locally (isn't sent to the audio mixer). This is the same as calling + * Starts playing the content of an audio file locally (isn't sent to the audio mixer). This is the same as calling * {@link Audio.playSound} with {@link AudioInjector.AudioInjectorOptions} localOnly set true and * the specified position. * @function Audio.playSystemSound - * @param {SoundObject} sound - The content of an audio file, loaded using {@link SoundCache.getSound}. See + * @param {SoundObject} sound - The content of an audio file, which is loaded using {@link SoundCache.getSound}. See * {@link SoundObject} for supported formats. * @returns {AudioInjector} The audio injector that plays the audio file. */ @@ -210,7 +211,7 @@ signals: /**jsdoc * Triggered when the client is muted by the mixer because their loudness value for the noise background has reached the - * threshold set for the domain in the server settings. + * threshold set for the domain (in the server settings). * @function Audio.mutedByMixer * @returns {Signal} */ @@ -239,7 +240,7 @@ signals: void disconnected(); /**jsdoc - * Triggered when the noise gate is opened: the input audio signal is no longer blocked (fully attenuated) because it has + * Triggered when the noise gate is opened. The input audio signal is no longer blocked (fully attenuated) because it has * risen above an adaptive threshold set just above the noise floor. Only occurs if Audio.noiseReduction is * true. * @function Audio.noiseGateOpened @@ -248,7 +249,7 @@ signals: void noiseGateOpened(); /**jsdoc - * Triggered when the noise gate is closed: the input audio signal is blocked (fully attenuated) because it has fallen + * Triggered when the noise gate is closed. The input audio signal is blocked (fully attenuated) because it has fallen * below an adaptive threshold set just above the noise floor. Only occurs if Audio.noiseReduction is * true. * @function Audio.noiseGateClosed diff --git a/libraries/script-engine/src/ScriptAudioInjector.h b/libraries/script-engine/src/ScriptAudioInjector.h index a67c15bace..3023623d72 100644 --- a/libraries/script-engine/src/ScriptAudioInjector.h +++ b/libraries/script-engine/src/ScriptAudioInjector.h @@ -17,7 +17,7 @@ #include /**jsdoc - * Plays — "injects" — the content of an audio file. + * Plays or "injects" the content of an audio file. * *

Create using {@link Audio} API methods.

* @@ -47,7 +47,7 @@ public: public slots: /**jsdoc - * Stops current playback, if any, and start playing from the beginning. + * Stops current playback, if any, and starts playing from the beginning. * @function AudioInjector.restart */ void restart() { DependencyManager::get()->restart(_injector); } From fbc8e1c347afcf8299aace0b873af56ab2e061d6 Mon Sep 17 00:00:00 2001 From: David Rowe Date: Tue, 23 Apr 2019 14:49:14 +1200 Subject: [PATCH 6/6] Miscellaneous fixes --- interface/src/scripting/Audio.h | 12 ++++++------ libraries/audio/src/AudioInjectorOptions.cpp | 4 ++-- 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/interface/src/scripting/Audio.h b/interface/src/scripting/Audio.h index 825393408e..63f8f51908 100644 --- a/interface/src/scripting/Audio.h +++ b/interface/src/scripting/Audio.h @@ -57,8 +57,8 @@ class Audio : public AudioScriptingInterface, protected ReadWriteLockable { * @property {boolean} clipping - true if the audio input is clipping, otherwise false. * @property {string} context - The current context of the audio: either "Desktop" or "HMD". * Read-only. - * @property {object} devices Read-only. Deprecated: This property is deprecated and will be - * removed. + * @property {object} devices - Read-only. + *

Deprecated: This property is deprecated and will be removed. * @property {boolean} pushToTalk - true if push-to-talk is enabled for the current user context (desktop or * HMD), otherwise false. * @property {boolean} pushToTalkDesktop - true if desktop push-to-talk is enabled, otherwise @@ -189,7 +189,7 @@ public: /**jsdoc * Sets the gain (relative volume) that avatars' voices are played at. This gain is used at the server. * @function Audio.setAvatarGain - * @param {number} Avatar gain (dB) at the server. + * @param {number} gain - Avatar gain (dB) at the server. */ Q_INVOKABLE void setAvatarGain(float gain); @@ -209,7 +209,7 @@ public: /**jsdoc * Sets the gain (relative volume) that environment sounds from the server are played at. * @function Audio.setInjectorGain - * @param {number} Injector gain (dB) at the server. + * @param {number} gain - Injector gain (dB) at the server. */ Q_INVOKABLE void setInjectorGain(float gain); @@ -223,7 +223,7 @@ public: /**jsdoc * Sets the gain (relative volume) that environment sounds from the client are played at. * @function Audio.setLocalInjectorGain - * @param {number} Injector gain (dB) in the client. + * @param {number} gain - Injector gain (dB) in the client. */ Q_INVOKABLE void setLocalInjectorGain(float gain); @@ -237,7 +237,7 @@ public: /**jsdoc * Sets the gain (relative volume) that system sounds are played at. * @function Audio.setSystemInjectorGain - * @param {number} Injector gain (dB) in the client. + * @param {number} gain - Injector gain (dB) in the client. */ Q_INVOKABLE void setSystemInjectorGain(float gain); diff --git a/libraries/audio/src/AudioInjectorOptions.cpp b/libraries/audio/src/AudioInjectorOptions.cpp index ee6b960e9f..cb7da4de33 100644 --- a/libraries/audio/src/AudioInjectorOptions.cpp +++ b/libraries/audio/src/AudioInjectorOptions.cpp @@ -63,8 +63,8 @@ QScriptValue injectorOptionsToScriptValue(QScriptEngine* engine, const AudioInje * 0. * @property {boolean} localOnly=false - If true, the sound is played back locally on the client rather than to * others via the audio mixer. - * @property {boolean} ignorePenumbra=false - Deprecated: This property is deprecated and will be - * removed. + * @property {boolean} ignorePenumbra=false -

Deprecated: This property is deprecated and will be + * removed.

*/ void injectorOptionsFromScriptValue(const QScriptValue& object, AudioInjectorOptions& injectorOptions) { if (!object.isObject()) {