Review example and screenshots
This commit is contained in:
parent
358ca7595d
commit
8f05322263
3 changed files with 6 additions and 33 deletions
|
@ -27,16 +27,7 @@ int main(void)
|
||||||
Sound fxWav = LoadSound("resources/sound.wav"); // Load WAV audio file
|
Sound fxWav = LoadSound("resources/sound.wav"); // Load WAV audio file
|
||||||
Sound fxOgg = LoadSound("resources/tanatana.ogg"); // Load OGG audio file
|
Sound fxOgg = LoadSound("resources/tanatana.ogg"); // Load OGG audio file
|
||||||
|
|
||||||
int frame = 0;
|
|
||||||
|
|
||||||
SetSoundVolume(fxWav, 0.2);
|
SetSoundVolume(fxWav, 0.2);
|
||||||
PlaySound(fxOgg);
|
|
||||||
|
|
||||||
bool inhibitWav = false;
|
|
||||||
bool inhibitOgg = false;
|
|
||||||
int maxFrame = 60;
|
|
||||||
|
|
||||||
int soundsCounter = 0;
|
|
||||||
|
|
||||||
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
SetTargetFPS(60); // Set our game to run at 60 frames-per-second
|
||||||
//--------------------------------------------------------------------------------------
|
//--------------------------------------------------------------------------------------
|
||||||
|
@ -46,26 +37,8 @@ int main(void)
|
||||||
{
|
{
|
||||||
// Update
|
// Update
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
frame++;
|
if (IsKeyPressed(KEY_ENTER)) PlaySoundMulti(fxWav); // Play a new wav sound instance
|
||||||
|
if (IsKeyPressed(KEY_SPACE)) PlaySoundMulti(fxOgg); // Play a new ogg sound instance
|
||||||
if (IsKeyDown(KEY_ENTER)) inhibitWav = !inhibitWav;
|
|
||||||
if (IsKeyDown(KEY_SPACE)) inhibitOgg = !inhibitOgg;
|
|
||||||
|
|
||||||
// Deliberatly hammer the play pool to see what dropping old pool entries sounds like....
|
|
||||||
if ((frame%5) == 0)
|
|
||||||
{
|
|
||||||
if (!inhibitWav) PlaySoundMulti(fxWav);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (frame == maxFrame)
|
|
||||||
{
|
|
||||||
if (!inhibitOgg) PlaySoundMulti(fxOgg);
|
|
||||||
|
|
||||||
frame = 0;
|
|
||||||
maxFrame = GetRandomValue(6,12);
|
|
||||||
}
|
|
||||||
|
|
||||||
soundsCounter = GetSoundsPlaying();
|
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
||||||
// Draw
|
// Draw
|
||||||
|
@ -74,11 +47,11 @@ int main(void)
|
||||||
|
|
||||||
ClearBackground(RAYWHITE);
|
ClearBackground(RAYWHITE);
|
||||||
|
|
||||||
DrawText("Multichannel sound abuse!", 200, 180, 20, LIGHTGRAY);
|
DrawText("MULTICHANNEL SOUND PLAYING", 20, 20, 20, GRAY);
|
||||||
DrawText("Space to inhibit new ogg triggering", 200, 200, 20, LIGHTGRAY);
|
DrawText("Press SPACE to play new ogg instance!", 200, 120, 20, LIGHTGRAY);
|
||||||
DrawText("Enter to inhibit new wav triggering", 200, 220, 20, LIGHTGRAY);
|
DrawText("Press ENTER to play new wav instance!", 200, 180, 20, LIGHTGRAY);
|
||||||
|
|
||||||
DrawText(FormatText("Number of concurrentsounds: %i", soundsCounter), 200, 280, 20, LIGHTGRAY);
|
DrawText(FormatText("CONCURRENT SOUNDS PLAYING: %02i", GetSoundsPlaying()), 220, 280, 20, RED);
|
||||||
|
|
||||||
EndDrawing();
|
EndDrawing();
|
||||||
//----------------------------------------------------------------------------------
|
//----------------------------------------------------------------------------------
|
||||||
|
|
BIN
examples/audio/audio_multichannel_sound.png
Normal file
BIN
examples/audio/audio_multichannel_sound.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 16 KiB |
BIN
examples/shaders/shaders_simple_mask.png
Normal file
BIN
examples/shaders/shaders_simple_mask.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 427 KiB |
Loading…
Add table
Add a link
Reference in a new issue