RetroArch
rwav.h
Go to the documentation of this file.
1 /* Copyright (C) 2010-2018 The RetroArch team
2  *
3  * ---------------------------------------------------------------------------------------
4  * The following license statement only applies to this file (rwav.h).
5  * ---------------------------------------------------------------------------------------
6  *
7  * Permission is hereby granted, free of charge,
8  * to any person obtaining a copy of this software and associated documentation files (the "Software"),
9  * to deal in the Software without restriction, including without limitation the rights to
10  * use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software,
11  * and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
12  *
13  * The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
14  *
15  * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED,
16  * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17  * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
18  * IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY,
19  * WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20  * OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
21  */
22 
23 #ifndef __LIBRETRO_SDK_FORMAT_RWAV_H__
24 #define __LIBRETRO_SDK_FORMAT_RWAV_H__
25 
26 #include <retro_common_api.h>
27 #include <stdint.h>
28 
30 
31 typedef struct
32 {
33  /* bits per sample */
34  unsigned int bitspersample;
35 
36  /* number of channels */
37  unsigned int numchannels;
38 
39  /* sample rate */
40  unsigned int samplerate;
41 
42  /* number of *samples* */
43  size_t numsamples;
44 
45  /* number of *bytes* in the pointer below, i.e. numsamples * numchannels * bitspersample/8 */
46  size_t subchunk2size;
47 
48  /* PCM data */
49  const void* samples;
50 } rwav_t;
51 
53 {
58 };
59 
61 
65 void rwav_init(rwav_iterator_t* iter, rwav_t* out, const void* buf, size_t size);
66 
74 
78 enum rwav_state rwav_load(rwav_t* out, const void* buf, size_t size);
79 
83 void rwav_free(rwav_t *rwav);
84 
86 
87 #endif
enum rwav_state rwav_load(rwav_t *out, const void *buf, size_t size)
Definition: rwav.c:161
#define RETRO_BEGIN_DECLS
Definition: retro_common_api.h:41
void rwav_free(rwav_t *rwav)
Definition: rwav.c:183
GLenum GLuint GLenum GLsizei const GLchar * buf
Definition: glext.h:8418
const void * samples
Definition: rwav.h:49
void rwav_init(rwav_iterator_t *iter, rwav_t *out, const void *buf, size_t size)
Definition: rwav.c:49
GLsizeiptr size
Definition: glext.h:6559
struct passwd out
Definition: missing_libc_functions.c:51
Definition: rwav.h:56
Definition: rwav.h:54
Definition: rwav.h:55
unsigned int numchannels
Definition: rwav.h:37
Definition: rwav.h:31
size_t numsamples
Definition: rwav.h:43
enum rwav_state rwav_iterate(rwav_iterator_t *iter)
Definition: rwav.c:59
unsigned int bitspersample
Definition: rwav.h:34
#define RETRO_END_DECLS
Definition: retro_common_api.h:42
Definition: rwav.h:57
unsigned int samplerate
Definition: rwav.h:40
rwav_state
Definition: rwav.h:52
size_t subchunk2size
Definition: rwav.h:46
Definition: rwav.c:40