Warning Sound Effect (#837)

* Better Highscore and ProgressBar Sound Effect

* Add Warning Sound Effect

* Add Warning Sound Effect

* Add Warning Sound Effect

* Add Warning Sound, Update Highscore & Elevating Sound

* Add Warning Sound Effect

* Add Warning Sound Effect

* Add Warning Sound Effect

* Add Warning Sound Effect

* Add Warning Sound Effect

* Add Warning Sound Effect

* Add Warning Sound Effect

* Add Warning Sound Effect

* Add Warning Sound Effect

* Add Warning Sound Effect

* Add Warning Sound Effect

* Add Warning Sound Effect

* Add Warning Sound Effect

* Add Warning Sound Effect

* Add Warning Sound Effect

* Add Warning Sound Effect

* Add Warning Sound Effect

* Renamed  _HasPlayedSound  to  _HasPlayedHighscoreSound  for clarity.

* Add Warning Sound Effect

* Add Warning Sound Effect

* Add Warning Sound Effect

* Add Warning Sound Effect

* Add Warning Sound Effect
This commit is contained in:
Edi316 authored and GitHub committed 2026-03-08 12:40:42 +01:00
1 parent 20c6898baa
commit 320082414a
12 files changed
+209 -11

No files matched your search

Binary file not shown.
Binary file not shown.
Binary file not shown.
+4 -2
View File
@@ -2,6 +2,7 @@
APPLAUSE SOUNDS
HIGHSCORE SOUND
ELEVATING SOUND
WARNING SOUND
-----
for free without attribution (check pixabay content license)
enjoy
@@ -10,5 +11,6 @@ enjoy
https://pixabay.com/de/sound-effects/small-applause-6695/
https://pixabay.com/de/sound-effects/short-crowd-cheer-6713/
https://pixabay.com/de/sound-effects/cheering-and-clapping-crowd-1-5995/
https://pixabay.com/de/sound-effects/achive-sound-132273/
https://pixabay.com/sound-effects/stuttering-climax-31002/
https://pixabay.com/sound-effects/film-special-effects-arcade-ui-6-229503/
https://pixabay.com/sound-effects/film-special-effects-047747-high-score-fill-75680/
https://pixabay.com/sound-effects/film-special-effects-error-call-to-attention-129258/
+1
View File
@@ -126,6 +126,7 @@ namespace Vocaluxe.Base
public const string FileNameSoundApplauseHigh = "ApplauseHigh.mp3";
public const string FileNameSoundHighscore = "Highscore.mp3";
public const string FileNameSoundProgressBar = "ProgressBar.mp3";
public const string FileNameSoundWarning = "Warning.mp3";
public const string FolderNameSongs = "Songs";
public const string FolderNameProfiles = "Profiles";
+5 -1
View File
@@ -33,7 +33,8 @@ namespace Vocaluxe.Base
ApplauseMid,
ApplauseHigh,
Highscore,
ProgressBar
ProgressBar,
Warning
}
static class CSound
@@ -206,6 +207,9 @@ namespace Vocaluxe.Base
case ESounds.ProgressBar:
file = Path.Combine(file, CSettings.FileNameSoundProgressBar);
break;
case ESounds.Warning:
file = Path.Combine(file, CSettings.FileNameSoundWarning);
break;
default:
return -1;
}
+4 -4
View File
@@ -58,7 +58,7 @@ namespace Vocaluxe.Screens
}
private int _HighscoreStream = -1;
private bool _HasPlayedSound = false;
private bool _HasPlayedHighscoreSound = false;
private static int PlaySound(ESounds sound, int volume)
{
@@ -197,10 +197,10 @@ namespace Vocaluxe.Screens
_ParticleEffects[_ParticleEffectNew[p]].Visible = _IsNewEntry(_Scores[_Round][_Pos + p].ID);
if (_ParticleEffects[_ParticleEffectNew[p]].Visible && !_HasPlayedSound)
if (_ParticleEffects[_ParticleEffectNew[p]].Visible && !_HasPlayedHighscoreSound)
{
_HighscoreStream = CScreenHighscore.PlaySound(ESounds.Highscore, CConfig.SoundEffectVolume);
_HasPlayedSound = true;
_HasPlayedHighscoreSound = true;
}
}
else
@@ -218,7 +218,7 @@ namespace Vocaluxe.Screens
public override void OnShow()
{
base.OnShow();
_HasPlayedSound = false;
_HasPlayedHighscoreSound = false;
_Round = 0;
_Pos = 0;
_NewEntryIDs.Clear();
+52 -1
View File
@@ -19,6 +19,7 @@ using System.Windows.Forms;
using Vocaluxe.Base;
using VocaluxeLib;
using VocaluxeLib.Menu;
using Vocaluxe.Lib.Sound;
namespace Vocaluxe.Screens
{
@@ -39,6 +40,17 @@ namespace Vocaluxe.Screens
private const string _TextWarningProfiles = "TextWarningProfiles";
private const string _TextRelease = "TextRelease";
private int _WarningStream = -1;
private bool _HasPlayedWarningSound = false;
private static int PlaySound(ESounds sound, int volume)
{
int streamId = CSound.PlaySound(sound, false);
CSound.SetStreamVolume(streamId, volume);
return streamId;
}
//CParticleEffect Snowflakes;
public override void Init()
{
@@ -71,19 +83,23 @@ namespace Vocaluxe.Screens
{
case Keys.O:
CGraphics.FadeTo(EScreen.Options);
_LeaveScreen();
break;
case Keys.S:
if (CProfiles.NumProfiles > 0)
CGraphics.FadeTo(EScreen.Song);
_LeaveScreen();
break;
case Keys.C:
CGraphics.FadeTo(EScreen.Credits);
_LeaveScreen();
break;
case Keys.T:
CGraphics.FadeTo(EScreen.Test);
_LeaveScreen();
break;
case Keys.Enter:
@@ -91,16 +107,26 @@ namespace Vocaluxe.Screens
{
CParty.SetNormalGameMode();
CGraphics.FadeTo(EScreen.Song);
_LeaveScreen();
}
if (_Buttons[_ButtonParty].Selected)
{
CGraphics.FadeTo(EScreen.Party);
_LeaveScreen();
}
if (_Buttons[_ButtonOptions].Selected)
{
CGraphics.FadeTo(EScreen.Options);
_LeaveScreen();
}
if (_Buttons[_ButtonProfiles].Selected)
{
CGraphics.FadeTo(EScreen.Profiles);
_LeaveScreen();
}
if (_Buttons[_ButtonExit].Selected)
return false;
@@ -125,16 +151,26 @@ namespace Vocaluxe.Screens
{
CParty.SetNormalGameMode();
CGraphics.FadeTo(EScreen.Song);
_LeaveScreen();
}
if (_Buttons[_ButtonParty].Selected)
{
CGraphics.FadeTo(EScreen.Party);
_LeaveScreen();
}
if (_Buttons[_ButtonOptions].Selected)
{
CGraphics.FadeTo(EScreen.Options);
_LeaveScreen();
}
if (_Buttons[_ButtonProfiles].Selected)
{
CGraphics.FadeTo(EScreen.Profiles);
_LeaveScreen();
}
if (_Buttons[_ButtonExit].Selected)
return false;
@@ -150,7 +186,22 @@ namespace Vocaluxe.Screens
_Texts[_TextWarningProfiles].Visible = !profileOK;
_Buttons[_ButtonSing].Selectable = profileOK;
_Buttons[_ButtonParty].Selectable = profileOK;
if (_Texts[_TextWarningProfiles].Visible && !_HasPlayedWarningSound)
{
_WarningStream = CScreenMain.PlaySound(ESounds.Warning, CConfig.SoundEffectVolume);
_HasPlayedWarningSound = true;
}
return true;
}
private void _LeaveScreen()
{
if (_WarningStream != -1)
{
CSound.Close(_WarningStream);
_WarningStream = -1;
}
}
}
}
}
+45 -2
View File
@@ -24,6 +24,7 @@ using VocaluxeLib.Draw;
using VocaluxeLib.Menu;
using VocaluxeLib.Songs;
using VocaluxeLib.Profile;
using Vocaluxe.Lib.Sound;
namespace Vocaluxe.Screens
{
@@ -70,6 +71,17 @@ namespace Vocaluxe.Screens
get { return EMusicType.BackgroundPreview; }
}
private int _WarningStream = -1;
private bool _HasPlayedWarningSound = false;
private static int PlaySound(ESounds sound, int volume)
{
int streamId = CSound.PlaySound(sound, false);
CSound.SetStreamVolume(streamId, volume);
return streamId;
}
#region public methods
public override void Init()
{
@@ -286,15 +298,21 @@ namespace Vocaluxe.Screens
case Keys.Escape:
case Keys.Back:
CGraphics.FadeTo(EScreen.Song);
_LeaveScreen();
break;
case Keys.Enter:
if (_Buttons[_ButtonBack].Selected)
{
CGraphics.FadeTo(EScreen.Song);
_LeaveScreen();
}
else if (_Buttons[_ButtonStart].Selected)
{
_StartSong();
_LeaveScreen();
}
break;
case Keys.D1:
@@ -469,9 +487,15 @@ namespace Vocaluxe.Screens
else if (mouseEvent.LB && _IsMouseOverCurSelection(mouseEvent))
{
if (_Buttons[_ButtonBack].Selected)
{
CGraphics.FadeTo(EScreen.Song);
_LeaveScreen();
}
else if (_Buttons[_ButtonStart].Selected)
{
_StartSong();
_LeaveScreen();
}
else
_UpdatePlayerNumber();
//Update Tiles-List
@@ -512,7 +536,10 @@ namespace Vocaluxe.Screens
}
}
if (exit)
{
CGraphics.FadeTo(EScreen.Song);
_LeaveScreen();
}
}
if (mouseEvent.MB && _SelectingFast)
@@ -562,6 +589,13 @@ namespace Vocaluxe.Screens
CRecord.AnalyzeBuffer(i - 1);
_Equalizers["EqualizerPlayer" + i].Update(CRecord.ToneWeigth(i - 1), CRecord.GetMaxVolume(i - 1));
}
if ((_Texts[_TextWarningMics].Visible || _Texts[_TextWarningProfiles].Visible) && !_HasPlayedWarningSound)
{
_WarningStream = CScreenNames.PlaySound(ESounds.Warning, CConfig.SoundEffectVolume);
_HasPlayedWarningSound = true;
}
return true;
}
@@ -803,6 +837,15 @@ namespace Vocaluxe.Screens
_Texts[_TextWarningProfiles].Visible = false;
}
}
private void _LeaveScreen()
{
if (_WarningStream != -1)
{
CSound.Close(_WarningStream);
_WarningStream = -1;
}
}
#endregion private methods
}
}
}
+32
View File
@@ -21,6 +21,7 @@ using System.Collections.Generic;
using Vocaluxe.Base;
using VocaluxeLib;
using VocaluxeLib.Menu;
using Vocaluxe.Lib.Sound;
namespace Vocaluxe.Screens
{
@@ -48,6 +49,17 @@ namespace Vocaluxe.Screens
private const string _TextWarningRestart = "TextWarningRestart";
private const string _StaticWarningRestart = "StaticWarningRestart";
private int _WarningStream = -1;
private bool _HasPlayedWarningSound = false;
private static int PlaySound(ESounds sound, int volume)
{
int streamId = CSound.PlaySound(sound, false);
CSound.SetStreamVolume(streamId, volume);
return streamId;
}
public override void Init()
{
base.Init();
@@ -89,12 +101,14 @@ namespace Vocaluxe.Screens
case Keys.Back:
_SaveConfig();
CGraphics.FadeTo(EScreen.Options);
_LeaveScreen();
break;
case Keys.S:
CParty.SetNormalGameMode();
_SaveConfig();
CGraphics.FadeTo(EScreen.Song);
_LeaveScreen();
break;
case Keys.Enter:
@@ -102,6 +116,7 @@ namespace Vocaluxe.Screens
{
_SaveConfig();
CGraphics.FadeTo(EScreen.Options);
_LeaveScreen();
}
else if (_Buttons[_ButtonServer].Selected)
{
@@ -134,6 +149,7 @@ namespace Vocaluxe.Screens
{
_SaveConfig();
CGraphics.FadeTo(EScreen.Options);
_LeaveScreen();
}
if (mouseEvent.LB && _IsMouseOverCurSelection(mouseEvent))
@@ -142,6 +158,7 @@ namespace Vocaluxe.Screens
{
CGraphics.FadeTo(EScreen.Options);
_SaveConfig();
_LeaveScreen();
}
else if (_Buttons[_ButtonServer].Selected)
{
@@ -158,6 +175,12 @@ namespace Vocaluxe.Screens
public override bool UpdateGame()
{
if (_Texts[_TextWarningRestart].Visible && !_HasPlayedWarningSound)
{
_WarningStream = CScreenOptionsGame.PlaySound(ESounds.Warning, CConfig.SoundEffectVolume);
_HasPlayedWarningSound = true;
}
return true;
}
@@ -200,5 +223,14 @@ namespace Vocaluxe.Screens
CSongs.Sorter.SongSorting = CConfig.Config.Game.SongSorting;
CSongs.Categorizer.Tabs = CConfig.Config.Game.Tabs;
}
private void _LeaveScreen()
{
if (_WarningStream != -1)
{
CSound.Close(_WarningStream);
_WarningStream = -1;
}
}
}
}
+33
View File
@@ -21,6 +21,7 @@ using System.IO;
using Vocaluxe.Base;
using VocaluxeLib;
using VocaluxeLib.Menu;
using Vocaluxe.Lib.Sound;
namespace Vocaluxe.Screens
{
@@ -43,6 +44,17 @@ namespace Vocaluxe.Screens
private const string _ButtonExit = "ButtonExit";
private static readonly string[] CoverSizes = { "32", "64", "128", "256", "512", "1024" };
private int _WarningStream = -1;
private bool _HasPlayedWarningSound = false;
private static int PlaySound(ESounds sound, int volume)
{
int streamId = CSound.PlaySound(sound, false);
CSound.SetStreamVolume(streamId, volume);
return streamId;
}
public override void Init()
{
base.Init();
@@ -89,12 +101,14 @@ namespace Vocaluxe.Screens
case Keys.Back:
_SaveConfig();
CGraphics.FadeTo(EScreen.Options);
_LeaveScreen();
break;
case Keys.S:
CParty.SetNormalGameMode();
_SaveConfig();
CGraphics.FadeTo(EScreen.Song);
_LeaveScreen();
break;
case Keys.Enter:
@@ -102,6 +116,7 @@ namespace Vocaluxe.Screens
{
_SaveConfig();
CGraphics.FadeTo(EScreen.Options);
_LeaveScreen();
}
break;
@@ -125,18 +140,27 @@ namespace Vocaluxe.Screens
{
_SaveConfig();
CGraphics.FadeTo(EScreen.Options);
_LeaveScreen();
}
if (mouseEvent.LB && _IsMouseOverCurSelection(mouseEvent))
{
_SaveConfig();
if (_Buttons[_ButtonExit].Selected)
{
CGraphics.FadeTo(EScreen.Options);
_LeaveScreen();
}
}
return true;
}
public override bool UpdateGame()
{
if (_Texts[_TextWarningRestart].Visible && !_HasPlayedWarningSound)
{
_WarningStream = CScreenOptionsLyrics.PlaySound(ESounds.Warning, CConfig.SoundEffectVolume);
_HasPlayedWarningSound = true;
}
return true;
}
@@ -181,5 +205,14 @@ namespace Vocaluxe.Screens
CConfig.SaveConfig();
}
private void _LeaveScreen()
{
if (_WarningStream != -1)
{
CSound.Close(_WarningStream);
_WarningStream = -1;
}
}
}
}
+33 -1
View File
@@ -20,6 +20,7 @@ using System.Collections.ObjectModel;
using System.Windows.Forms;
using Vocaluxe.Base;
using Vocaluxe.Base.ThemeSystem;
using Vocaluxe.Lib.Sound;
using Vocaluxe.Lib.Sound.Record;
using VocaluxeLib;
using VocaluxeLib.Menu;
@@ -65,6 +66,17 @@ namespace Vocaluxe.Screens
get { return EMusicType.Game; }
}
private int _WarningStream = -1;
private bool _HasPlayedWarningSound = false;
private static int PlaySound(ESounds sound, int volume)
{
int streamId = CSound.PlaySound(sound, false);
CSound.SetStreamVolume(streamId, volume);
return streamId;
}
public override void Init()
{
base.Init();
@@ -108,12 +120,14 @@ namespace Vocaluxe.Screens
case Keys.Back:
_SaveMicConfig();
CGraphics.FadeTo(EScreen.Options);
_LeaveScreen();
break;
case Keys.S:
CParty.SetNormalGameMode();
_SaveMicConfig();
CGraphics.FadeTo(EScreen.Song);
_LeaveScreen();
break;
case Keys.Enter:
@@ -121,6 +135,7 @@ namespace Vocaluxe.Screens
{
_SaveMicConfig();
CGraphics.FadeTo(EScreen.Options);
_LeaveScreen();
}
if (_Buttons[_ButtonDelayTest].Selected)
@@ -152,6 +167,7 @@ namespace Vocaluxe.Screens
{
_SaveMicConfig();
CGraphics.FadeTo(EScreen.Options);
_LeaveScreen();
}
if (mouseEvent.LB && _IsMouseOverCurSelection(mouseEvent))
@@ -162,6 +178,7 @@ namespace Vocaluxe.Screens
{
_SaveMicConfig();
CGraphics.FadeTo(EScreen.Options);
_LeaveScreen();
}
if (_Buttons[_ButtonDelayTest].Selected)
@@ -210,6 +227,12 @@ namespace Vocaluxe.Screens
_Statics[_StaticWarning].Visible = showWarning;
_Texts[_TextWarning].Visible = showWarning;
if (_Texts[_TextWarning].Visible && !_HasPlayedWarningSound)
{
_WarningStream = CScreenOptionsRecord.PlaySound(ESounds.Warning, CConfig.SoundEffectVolume);
_HasPlayedWarningSound = true;
}
return true;
}
@@ -435,5 +458,14 @@ namespace Vocaluxe.Screens
}
}
}
private void _LeaveScreen()
{
if (_WarningStream != -1)
{
CSound.Close(_WarningStream);
_WarningStream = -1;
}
}
}
}
}