Signal Audio.disconnected, and use new hello/goodbye sounds in resources.

This commit is contained in:
Howard Stearns 2015-06-11 20:33:30 -07:00
parent c0deff9fdc
commit 27f40ea881
7 changed files with 13 additions and 2 deletions

View file

@ -3,6 +3,7 @@
// examples
//
// Created by Stephen Birarda on 06/08/15.
// Added disconnect HRS 6/11/15.
// Copyright 2015 High Fidelity, Inc.
//
// Distributed under the Apache License, Version 2.0.
@ -10,14 +11,19 @@
//
// setup the local sound we're going to use
var connectSound = SoundCache.getSound("file://" + Paths.resources + "sounds/short1.wav");
var connectSound = SoundCache.getSound("file://" + Paths.resources + "sounds/hello.wav");
var disconnectSound = SoundCache.getSound("file://" + Paths.resources + "sounds/goodbye.wav");
// setup the options needed for that sound
var connectSoundOptions = {
localOnly: true
}
};
// play the sound locally once we get the first audio packet from a mixer
Audio.receivedFirstPacket.connect(function(){
Audio.playSound(connectSound, connectSoundOptions);
});
Audio.disconnected.connect(function(){
Audio.playSound(disconnectSound, connectSoundOptions);
});

Binary file not shown.

Binary file not shown.

View file

@ -425,6 +425,8 @@ Application::Application(int& argc, char** argv, QElapsedTimer &startup_time) :
connect(audioIO.data(), &AudioClient::muteToggled, this, &Application::audioMuteToggled);
connect(audioIO.data(), &AudioClient::receivedFirstPacket,
&AudioScriptingInterface::getInstance(), &AudioScriptingInterface::receivedFirstPacket);
connect(audioIO.data(), &AudioClient::disconnected,
&AudioScriptingInterface::getInstance(), &AudioScriptingInterface::disconnected);
audioThread->start();

View file

@ -156,6 +156,7 @@ void AudioClient::audioMixerKilled() {
_hasReceivedFirstPacket = false;
_outgoingAvatarAudioSequenceNumber = 0;
_stats.reset();
emit disconnected();
}

View file

@ -186,6 +186,7 @@ signals:
void deviceChanged();
void receivedFirstPacket();
void disconnected();
protected:
AudioClient();

View file

@ -39,6 +39,7 @@ signals:
void mutedByMixer();
void environmentMuted();
void receivedFirstPacket();
void disconnected();
private:
AudioScriptingInterface();