emilib
wav.hpp
1 // By Emil Ernerfeldt 2014-2016
2 // LICENSE:
3 // This software is dual-licensed to the public domain and under the following
4 // license: you are granted a perpetual, irrevocable license to copy, modify,
5 // publish, and distribute this file as you see fit.
6 // HISTORY:
7 // Created in 2014 for Ghostel.
8 
9 #pragma once
10 
11 #include <cstddef> // size_t
12 
13 namespace emilib {
14 
15 struct Wav
16 {
17  double duration_sec;
18  int channels;
21  const void* data;
22  size_t data_size;
23 };
24 
26 Wav parse_wav(const void* wav_data, size_t size_bytes);
27 
28 } // namespace emilib
double duration_sec
Length of the sound in seconds.
Definition: wav.hpp:17
const void * data
Sample data, little-endian.
Definition: wav.hpp:21
int sample_rate
Frames per second. Probably 44100.
Definition: wav.hpp:20
Definition: wav.hpp:15
int bits_per_sample
Probably 16.
Definition: wav.hpp:19
size_t data_size
Number of bytes in &#39;data&#39;.
Definition: wav.hpp:22
int channels
1=mono, 2=stereo.
Definition: wav.hpp:18
Definition: coroutine.hpp:18