File tree Expand file tree Collapse file tree 1 file changed +19
-0
lines changed
Expand file tree Collapse file tree 1 file changed +19
-0
lines changed Original file line number Diff line number Diff line change @@ -85,6 +85,25 @@ public slots:
8585 * Gets the current configuration of the audio injector.
8686 * @function AudioInjector.getOptions
8787 * @returns {AudioInjector.AudioInjectorOptions} Configuration of how the injector plays the audio.
88+ * @example <caption>Prints injector options to log</caption>
89+ * let sound = SoundCache.getSound(Script.resourcesPath() + "sounds/sample.wav");
90+ * let injector;
91+ * let injectorOptions = {
92+ * position: MyAvatar.position,
93+ * volume: 0.8,
94+ * };
95+
96+ * Script.setTimeout(function () { // Give the sound time to load.
97+ * injector = Audio.playSound(sound, injectorOptions);
98+ * }, 1000);
99+ *
100+ * Script.setTimeout(function () {
101+ * const options = injector.getOptions();
102+ *
103+ * print("Current AudioInjectorOptions: ",JSON.stringify(options)); // Print all options to log
104+ *
105+ * print("Volume is set to ", options.volume);
106+ * }, 2000);
88107 */
89108 AudioInjectorOptions getOptions () const { return DependencyManager::get<AudioInjectorManager>()->getOptions (_injector); }
90109
You can’t perform that action at this time.
0 commit comments