A modern Music Player Daemon based on Rockbox open source high quality audio player
libadwaita audio rust zig deno mpris rockbox mpd
at master 87 lines 2.1 kB view raw
1/* 2 * xrick/data/sounds.h 3 * 4 * Copyright (C) 2008-2014 Pierluigi Vicinanza. All rights reserved. 5 * 6 * The use and distribution terms for this software are contained in the file 7 * named README, which can be found in the root of this distribution. By 8 * using this software in any fashion, you are agreeing to be bound by the 9 * terms of this license. 10 * 11 * You must not remove this notice, or any other, from this software. 12 */ 13 14#ifndef _SOUNDS_H 15#define _SOUNDS_H 16 17#include "xrick/config.h" 18 19#ifdef ENABLE_SOUND 20 21#include "xrick/system/basic_types.h" 22 23typedef struct { 24 char *name; 25 U8 *buf; 26 U32 len; 27 bool dispose; 28} sound_t; 29 30enum 31{ 32 /* expected format is 8-bit mono at 22050Hz */ 33 Wave_SAMPLE_RATE = 22050, 34 Wave_AUDIO_FORMAT = 1, /* PCM = 1 (i.e. Linear quantization) */ 35 Wave_CHANNEL_COUNT = 1, 36 Wave_BITS_PER_SAMPLE = 8, 37}; 38 39typedef struct { 40 /* "RIFF" chunk descriptor */ 41 U8 riffChunkId[4]; 42 U8 riffChunkSize[4]; 43 U8 riffType[4]; 44 /* "fmt" sub-chunk */ 45 U8 formatChunkId[4]; 46 U8 formatChunkSize[4]; 47 U8 audioFormat[2]; 48 U8 channelCount[2]; 49 U8 sampleRate[4]; 50 U8 byteRate[4]; 51 U8 blockAlign[2]; 52 U8 bitsPerSample[2]; 53 /* "data" sub-chunk */ 54 U8 dataChunkId[4]; 55 U8 dataChunkSize[4]; 56} wave_header_t; 57 58/* apparently there are 10 entity sounds in original game (ref. "e_them.c" notes)? However we only have 9 so far... */ 59enum { SOUNDS_NBR_ENTITIES = 10 }; 60 61extern sound_t *soundBombshht; 62extern sound_t *soundBonus; 63extern sound_t *soundBox; 64extern sound_t *soundBullet; 65extern sound_t *soundCrawl; 66extern sound_t *soundDie; 67extern sound_t *soundEntity[SOUNDS_NBR_ENTITIES]; 68extern sound_t *soundExplode; 69extern sound_t *soundGameover; 70extern sound_t *soundJump; 71extern sound_t *soundPad; 72extern sound_t *soundSbonus1; 73extern sound_t *soundSbonus2; 74extern sound_t *soundStick; 75extern sound_t *soundTune0; 76extern sound_t *soundTune1; 77extern sound_t *soundTune2; 78extern sound_t *soundTune3; 79extern sound_t *soundTune4; 80extern sound_t *soundTune5; 81extern sound_t *soundWalk; 82 83#endif /* ENABLE_SOUND */ 84 85#endif /* ndef _SOUNDS_H */ 86 87/* eof */