Initial commit

This commit is contained in:
Quinn
2024-12-02 10:37:52 +01:00
committed by GitHub
commit 8bdf6bf2d2
15 changed files with 515 additions and 0 deletions

21
src/window/audio.h Normal file
View File

@@ -0,0 +1,21 @@
#pragma once
#include <SDL2/SDL.h>
typedef struct {
Uint32 length;
Uint32 mixed_amount;
Uint8* buffer;
} AudioData;
typedef struct {
SDL_AudioDeviceID id;
int freq;
SDL_AudioFormat format;
Uint8 channels;
AudioData* playing_audio;
} AudioDevice;
AudioData audio_load_wav(const AudioDevice* audio_device, const char* file_path);
AudioDevice* audio_device_init(const int freq, const SDL_AudioFormat format, const Uint8 channels, const Uint16 samples);
void audio_play(const AudioDevice* audio_device, const AudioData audio);