aboutsummaryrefslogtreecommitdiff
path: root/sdl2/audio.ha
diff options
context:
space:
mode:
authorDrew DeVault <sir@cmpwn.com>2021-12-12 12:40:47 +0100
committerDrew DeVault <sir@cmpwn.com>2021-12-12 13:04:42 +0100
commite5ad22498ca893e96557486a808213b05601e25f (patch)
tree8929b40773af11371cb961379daa8cb3be22b8b2 /sdl2/audio.ha
parentAdd blend modes (diff)
downloadhare-chip8-e5ad22498ca893e96557486a808213b05601e25f.tar.gz
sdl2::mixer: initial commit
Diffstat (limited to 'sdl2/audio.ha')
-rw-r--r--sdl2/audio.ha31
1 files changed, 31 insertions, 0 deletions
diff --git a/sdl2/audio.ha b/sdl2/audio.ha
new file mode 100644
index 0000000..42c4b95
--- /dev/null
+++ b/sdl2/audio.ha
@@ -0,0 +1,31 @@
+// Audio format flags.
+//
+// Current representation (unspecified bits are always zero):
+//
+// ++-----------------------sample is signed if set
+// ||
+// || ++-----------sample is bigendian if set
+// || ||
+// || || ++---sample is float if set
+// || || ||
+// || || || +---sample bit size---+
+// || || || | |
+// 15 14 13 12 11 10 09 08 07 06 05 04 03 02 01 00
+export type audio_format = u16;
+
+// Unsigned 8-bit samples
+export def AUDIO_U8: audio_format = 0x0008;
+// Signed 8-bit samples
+export def AUDIO_S8: audio_format = 0x8008;
+// Unsigned 16-bit samples, little-endian
+export def AUDIO_U16LSB: audio_format = 0x0010;
+// Signed 16-bit samples, little-endian
+export def AUDIO_S16LSB: audio_format = 0x8010;
+// Unsigned 16-bit samples, big-endian
+export def AUDIO_U16MSB: audio_format = 0x1010;
+// Signed 16-bit samples, big-endian
+export def AUDIO_S16MSB: audio_format = 0x9010;
+// Unsigned 16-bit samples
+export def AUDIO_U16: audio_format = AUDIO_U16LSB;
+// Signed 16-bit samples
+export def AUDIO_S16: audio_format = AUDIO_S16LSB;