mirror of
https://github.com/JulianGro/overte.git
synced 2025-04-07 19:23:04 +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
|
||||
//
|
||||
// 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);
|
||||
});
|
||||
|
|
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::receivedFirstPacket,
|
||||
&AudioScriptingInterface::getInstance(), &AudioScriptingInterface::receivedFirstPacket);
|
||||
connect(audioIO.data(), &AudioClient::disconnected,
|
||||
&AudioScriptingInterface::getInstance(), &AudioScriptingInterface::disconnected);
|
||||
|
||||
audioThread->start();
|
||||
|
||||
|
|
|
@ -156,6 +156,7 @@ void AudioClient::audioMixerKilled() {
|
|||
_hasReceivedFirstPacket = false;
|
||||
_outgoingAvatarAudioSequenceNumber = 0;
|
||||
_stats.reset();
|
||||
emit disconnected();
|
||||
}
|
||||
|
||||
|
||||
|
|
|
@ -186,6 +186,7 @@ signals:
|
|||
void deviceChanged();
|
||||
|
||||
void receivedFirstPacket();
|
||||
void disconnected();
|
||||
|
||||
protected:
|
||||
AudioClient();
|
||||
|
|
|
@ -39,6 +39,7 @@ signals:
|
|||
void mutedByMixer();
|
||||
void environmentMuted();
|
||||
void receivedFirstPacket();
|
||||
void disconnected();
|
||||
|
||||
private:
|
||||
AudioScriptingInterface();
|
||||
|
|
Loading…
Reference in a new issue