aboutsummaryrefslogtreecommitdiff
path: root/src/client/sound.h
diff options
context:
space:
mode:
authorfschildt <florian.schildt@protonmail.com>2025-08-22 15:23:11 +0200
committerfschildt <florian.schildt@protonmail.com>2025-08-22 15:23:11 +0200
commit2050c0e0576f05156f192aa4caf48834d2f28b14 (patch)
treeee58bd35b0df0a1bacfbc9700ed99ce80c99294e /src/client/sound.h
first commitHEADmaster
Diffstat (limited to 'src/client/sound.h')
-rw-r--r--src/client/sound.h30
1 files changed, 30 insertions, 0 deletions
diff --git a/src/client/sound.h b/src/client/sound.h
new file mode 100644
index 0000000..e1b456a
--- /dev/null
+++ b/src/client/sound.h
@@ -0,0 +1,30 @@
+#ifndef SOUND_H
+#define SOUND_H
+
+
+#include <basic/arena.h>
+#include <os/os.h>
+#include <basic/basic.h>
+
+typedef enum {
+ SOUND_USER_CONNECTED,
+ SOUND_USER_DISCONNECTED
+} SoundId;
+
+typedef struct {
+ i32 samples_per_second;
+ i32 sample_count;
+ i16 *samples;
+} Sound;
+
+typedef struct {
+ i32 play_cursor;
+ Sound *sound;
+} PlaySound;
+
+void play_sound_init(PlaySound *ps, Sound *sound);
+void play_sound_update(PlaySound *ps, OSSoundBuffer *dest);
+Sound *sound_load(SoundId id);
+
+
+#endif // SOUND_H