From 4cc0f8b608bdbfd4ed929e1ad3273b94a87e8d42 Mon Sep 17 00:00:00 2001 From: RandyGaul Date: Sun, 13 Nov 2022 17:59:35 -0800 Subject: [PATCH] Integrate cute_sound.h --- CMakeLists.txt | 1 + include/blah_app.h | 3 + include/blah_audio.h | 139 + src/blah_app.cpp | 17 + src/blah_audio.cpp | 258 ++ src/internal/blah_internal.h | 14 + src/third_party/cute_sound.h | 3169 ++++++++++++++++++++ src/third_party/stb_vorbis.c | 5397 ++++++++++++++++++++++++++++++++++ 8 files changed, 8998 insertions(+) create mode 100644 include/blah_audio.h create mode 100644 src/blah_audio.cpp create mode 100644 src/third_party/cute_sound.h create mode 100644 src/third_party/stb_vorbis.c diff --git a/CMakeLists.txt b/CMakeLists.txt index 5b7d640..f468251 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -21,6 +21,7 @@ add_library(blah src/blah_font.cpp src/blah_image.cpp src/blah_packer.cpp + src/blah_audio.cpp src/internal/blah_renderer_opengl.cpp src/internal/blah_renderer_d3d11.cpp src/internal/blah_platform_sdl2.cpp diff --git a/include/blah_app.h b/include/blah_app.h index 27b370a..7c7d619 100644 --- a/include/blah_app.h +++ b/include/blah_app.h @@ -47,6 +47,9 @@ namespace Blah // defaults to 60. int target_framerate = 60; + // The expected freqeuncy of audio files and how quickly to play audio. + int audio_frequency_in_Hz = 44100; + // default starting flags u32 flags = Flags::VSync | Flags::Resizable | Flags::FixedTimestep; diff --git a/include/blah_audio.h b/include/blah_audio.h new file mode 100644 index 0000000..967008e --- /dev/null +++ b/include/blah_audio.h @@ -0,0 +1,139 @@ +#pragma once + +#include +#include +#include + +namespace Blah +{ + class Audio; + class Sound; + using AudioRef = Ref