AudioScriptingInterface.setStereoInput's return value being removed from the API


#1

The AudioScriptingInterface.setStereoInput function currently returns a boolean to signal whether the call has succeeded.
(You cannot set as a stereo input, an audio device that does not support stereo. And trying to do so will fail)

That function as now been made asynchronous and so it cannot return whether it succeeded or failed immediately. As of RC69 it will always return true even if it fails, and as of RC71, it won’t return anything.

Instead, it has been turned into a Q_PROPERTY and will emit a signal when the value changes.
That means you can now do this:

AudioScriptingInterface.isStereoInputChanged.connect(function(newValue) {
    console.log("The new isStereoInput value is: " + newValue);
});
var currentValue = AudioScriptingInterface.isStereoInput();
AudioScriptingInterface.setStereoInput(!currentValue);

or this:

AudioScriptingInterface.isStereoInputChanged.connect(function(newValue) {
    console.log("The new isStereoInput value is: " + AudioScriptingInterface.isStereoInput);
});
AudioScriptingInterface.isStereoInput = !AudioScriptingInterface.isStereoInput;

That also means you can use QML bindings with AudioScriptingInterface.isStereoInput

If you have any questions regarding why we made that change, feel free to fire away!


#2

So it will remain on even with a mono source?
Seems good will I still need to enable stereo everyone I play music ?
I play it from a different source than I use for my mic
Would be nice to use 2 sources simultaneously so I can play music and talk


#3

You say that high fidelity still not have music stream support ? Because you not stream music from avatar, that’s bad. besides i tried it long ago and it worked very bad.


#4

I warmed to if cos it’s much better sounding the usual shout cast muffled mp3. But it required me getting a lot of gear to work as I want to use it
I still want iTunes or whatever to show up in the audio devices to make it easy for everyone


#5

In other words. you need a “speaker” avatar that you use fopr the music. And then your normal avatar for the fun. :crazy_face: That’s making things extra complex.


#6

No, mono sources cannot stream in stereo (at least on windows, it is implementation dependent).

To be clear, the current behavior of the product regarding audio and stereo should not change in any way.
This is only a change in the way those functions are called/used from JS/QML to accomplish what you want to do.
The stereo behavior is still the same.


#7

When you say mono are you talking same from both left and right speaker or through just the one channel?
oh god semantics


#8

I mean 1 channel. :slight_smile:
If you were to feed the same audio through 2 different channels that would technically be a stereo audio stream, though it would sound the same as a mono stream.

Basically, on Windows, if your input device does not have 2 channels, we won’t let you enable stereo (there’s no point really, it only has one channel).
I believe on mac, it will let you do it, but it’ll duplicate the channel into two. So it doesn’t really do anything either except take twice the bandwidth and make the mixer work harder.


#10

I knew if i made a comment about stereo i would be panned


#11

this is a great addition for log-checking. i used to get so confused about my mono vs stereo settings!