Added stereo option to the AudioInjector

This commit is contained in:
Atlante45 2014-09-05 14:34:55 -07:00
parent c2db0c6a30
commit 507419162c
4 changed files with 12 additions and 0 deletions

View file

@ -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();

View file

@ -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;
}

View file

@ -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;
};

View file

@ -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;