mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 03:24:00 +02:00
Added stereo option to the AudioInjector
This commit is contained in:
parent
c2db0c6a30
commit
507419162c
4 changed files with 12 additions and 0 deletions
|
@ -65,6 +65,9 @@ void AudioInjector::injectAudio() {
|
|||
int numPreSequenceNumberBytes = injectAudioPacket.size();
|
||||
packetStream << (quint16)0;
|
||||
|
||||
// pack the stereo/mono type of the stream
|
||||
packetStream << _options.isStereo();
|
||||
|
||||
// pack stream identifier (a generated UUID)
|
||||
packetStream << QUuid::createUuid();
|
||||
|
||||
|
|
|
@ -17,6 +17,7 @@ AudioInjectorOptions::AudioInjectorOptions(QObject* parent) :
|
|||
_volume(1.0f),
|
||||
_loop(false),
|
||||
_orientation(glm::vec3(0.0f, 0.0f, 0.0f)),
|
||||
_isStereo(false),
|
||||
_loopbackAudioInterface(NULL)
|
||||
{
|
||||
}
|
||||
|
@ -26,6 +27,7 @@ AudioInjectorOptions::AudioInjectorOptions(const AudioInjectorOptions& other) {
|
|||
_volume = other._volume;
|
||||
_loop = other._loop;
|
||||
_orientation = other._orientation;
|
||||
_isStereo = other._isStereo;
|
||||
_loopbackAudioInterface = other._loopbackAudioInterface;
|
||||
}
|
||||
|
||||
|
@ -34,5 +36,6 @@ void AudioInjectorOptions::operator=(const AudioInjectorOptions& other) {
|
|||
_volume = other._volume;
|
||||
_loop = other._loop;
|
||||
_orientation = other._orientation;
|
||||
_isStereo = other._isStereo;
|
||||
_loopbackAudioInterface = other._loopbackAudioInterface;
|
||||
}
|
|
@ -44,6 +44,9 @@ public:
|
|||
const glm::quat& getOrientation() const { return _orientation; }
|
||||
void setOrientation(const glm::quat& orientation) { _orientation = orientation; }
|
||||
|
||||
const bool isStereo() const { return _isStereo; }
|
||||
void setIsStereo(const bool isStereo) { _isStereo = isStereo; }
|
||||
|
||||
AbstractAudioInterface* getLoopbackAudioInterface() const { return _loopbackAudioInterface; }
|
||||
void setLoopbackAudioInterface(AbstractAudioInterface* loopbackAudioInterface)
|
||||
{ _loopbackAudioInterface = loopbackAudioInterface; }
|
||||
|
@ -52,6 +55,7 @@ private:
|
|||
float _volume;
|
||||
bool _loop;
|
||||
glm::quat _orientation;
|
||||
bool _isStereo;
|
||||
AbstractAudioInterface* _loopbackAudioInterface;
|
||||
};
|
||||
|
||||
|
|
|
@ -36,6 +36,8 @@ int InjectedAudioStream::parseStreamProperties(PacketType type, const QByteArray
|
|||
|
||||
// skip the stream identifier
|
||||
packetStream.skipRawData(NUM_BYTES_RFC4122_UUID);
|
||||
|
||||
packetStream >> _isStereo;
|
||||
|
||||
// pull the loopback flag and set our boolean
|
||||
uchar shouldLoopback;
|
||||
|
|
Loading…
Reference in a new issue