mirror of
https://github.com/overte-org/overte.git
synced 2025-08-04 04:23:33 +02:00
Signal Audio.disconnected, and use new hello/goodbye sounds in resources.
This commit is contained in:
parent
c0deff9fdc
commit
27f40ea881
7 changed files with 13 additions and 2 deletions
|
@ -3,6 +3,7 @@
|
||||||
// examples
|
// examples
|
||||||
//
|
//
|
||||||
// Created by Stephen Birarda on 06/08/15.
|
// Created by Stephen Birarda on 06/08/15.
|
||||||
|
// Added disconnect HRS 6/11/15.
|
||||||
// Copyright 2015 High Fidelity, Inc.
|
// Copyright 2015 High Fidelity, Inc.
|
||||||
//
|
//
|
||||||
// Distributed under the Apache License, Version 2.0.
|
// Distributed under the Apache License, Version 2.0.
|
||||||
|
@ -10,14 +11,19 @@
|
||||||
//
|
//
|
||||||
|
|
||||||
// setup the local sound we're going to use
|
// 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
|
// setup the options needed for that sound
|
||||||
var connectSoundOptions = {
|
var connectSoundOptions = {
|
||||||
localOnly: true
|
localOnly: true
|
||||||
}
|
};
|
||||||
|
|
||||||
// play the sound locally once we get the first audio packet from a mixer
|
// play the sound locally once we get the first audio packet from a mixer
|
||||||
Audio.receivedFirstPacket.connect(function(){
|
Audio.receivedFirstPacket.connect(function(){
|
||||||
Audio.playSound(connectSound, connectSoundOptions);
|
Audio.playSound(connectSound, connectSoundOptions);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Audio.disconnected.connect(function(){
|
||||||
|
Audio.playSound(disconnectSound, connectSoundOptions);
|
||||||
|
});
|
||||||
|
|
BIN
interface/resources/sounds/goodbye.wav
Normal file
BIN
interface/resources/sounds/goodbye.wav
Normal file
Binary file not shown.
BIN
interface/resources/sounds/hello.wav
Normal file
BIN
interface/resources/sounds/hello.wav
Normal file
Binary file not shown.
|
@ -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::muteToggled, this, &Application::audioMuteToggled);
|
||||||
connect(audioIO.data(), &AudioClient::receivedFirstPacket,
|
connect(audioIO.data(), &AudioClient::receivedFirstPacket,
|
||||||
&AudioScriptingInterface::getInstance(), &AudioScriptingInterface::receivedFirstPacket);
|
&AudioScriptingInterface::getInstance(), &AudioScriptingInterface::receivedFirstPacket);
|
||||||
|
connect(audioIO.data(), &AudioClient::disconnected,
|
||||||
|
&AudioScriptingInterface::getInstance(), &AudioScriptingInterface::disconnected);
|
||||||
|
|
||||||
audioThread->start();
|
audioThread->start();
|
||||||
|
|
||||||
|
|
|
@ -156,6 +156,7 @@ void AudioClient::audioMixerKilled() {
|
||||||
_hasReceivedFirstPacket = false;
|
_hasReceivedFirstPacket = false;
|
||||||
_outgoingAvatarAudioSequenceNumber = 0;
|
_outgoingAvatarAudioSequenceNumber = 0;
|
||||||
_stats.reset();
|
_stats.reset();
|
||||||
|
emit disconnected();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -186,6 +186,7 @@ signals:
|
||||||
void deviceChanged();
|
void deviceChanged();
|
||||||
|
|
||||||
void receivedFirstPacket();
|
void receivedFirstPacket();
|
||||||
|
void disconnected();
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
AudioClient();
|
AudioClient();
|
||||||
|
|
|
@ -39,6 +39,7 @@ signals:
|
||||||
void mutedByMixer();
|
void mutedByMixer();
|
||||||
void environmentMuted();
|
void environmentMuted();
|
||||||
void receivedFirstPacket();
|
void receivedFirstPacket();
|
||||||
|
void disconnected();
|
||||||
|
|
||||||
private:
|
private:
|
||||||
AudioScriptingInterface();
|
AudioScriptingInterface();
|
||||||
|
|
Loading…
Reference in a new issue