2 * This file is part of DisOrder
3 * Copyright (C) 2007 Richard Kettlewell
5 * This program is free software: you can redistribute it and/or modify
6 * it under the terms of the GNU General Public License as published by
7 * the Free Software Foundation, either version 3 of the License, or
8 * (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://www.gnu.org/licenses/>.
19 * @brief WAV file support
27 /** @brief WAV file access structure */
29 /** @brief File read handle */
30 struct hreader input[1];
32 /** @brief File length */
35 /** @brief Offset of data chunk */
38 /** @brief Sample rate (Hz) */
41 /** @brief Number of channels (usually 1 or 2) */
44 /** @brief Bits per sample */
47 /** @brief Size of data chunk in bytes */
51 /** @brief Sample data callback from wav_data()
52 * @param f WAV file being read
53 * @param data Pointer to sample data
54 * @param nbytes Number of bytes of data
55 * @param u As passed to wav_data()
56 * @return 0 on success or an errno value on error
58 * @p nbytes is always a multiple of the frame size and never 0.
60 typedef int wav_data_callback(struct wavfile *f,
65 int wav_init(struct wavfile *f, const char *path);
66 void wav_destroy(struct wavfile *f);
67 int wav_data(struct wavfile *f,
68 wav_data_callback *callback,