1 /* vim: set ts=4 sw=4 et: */
4 * Support for reading and writing AU/SND files
6 * Copyright (C) 2006 Nokia Corporation
9 * This program is free software; you can redistribute it and/or modify
10 * it under the terms of the GNU General Public License version 2 as
11 * published by the Free Software Foundation.
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
15 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
18 * You should have received a copy of the GNU General Public License along
19 * with this program; if not, write to the Free Software Foundation, Inc.,
20 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
24 #ifndef MAEMO_RECORDER_AU_H
25 #define MAEMO_RECORDER_AU_H
27 #include <libgnomevfs/gnome-vfs.h>
33 #define AU_MAGIC ((uint32_t) 0x2e736e64) /* ".snd" */
34 #define AU_SIZE_UNKNOWN (~0) /* (unsigned) -1 */
38 AU_ENCODING_MULAW_8 = 1, /* 8-bit ISDN u-law */
39 AU_ENCODING_LINEAR_8 = 2, /* 8-bit linear PCM */
40 AU_ENCODING_LINEAR_16 = 3, /* 16-bit linear PCM */
41 AU_ENCODING_LINEAR_24 = 4, /* 24-bit linear PCM */
42 AU_ENCODING_LINEAR_32 = 5, /* 32-bit linear PCM */
43 AU_ENCODING_FLOAT = 6, /* 32-bit IEEE floating point */
44 AU_ENCODING_DOUBLE = 7, /* 64-bit IEEE floating point */
45 AU_ENCODING_ADPCM_G721 = 23, /* 4-bit CCITT g.721 ADPCM */
46 AU_ENCODING_ADPCM_G722 = 24, /* CCITT g.722 ADPCM */
47 AU_ENCODING_ADPCM_G723_3 = 25, /* CCITT g.723 3-bit ADPCM */
48 AU_ENCODING_ADPCM_G723_5 = 26, /* CCITT g.723 5-bit ADPCM */
49 AU_ENCODING_ALAW_8 = 27 /* 8-bit ISDN A-law */
61 } __attribute__((__packed__));
64 gint au_write(GnomeVFSHandle *handle, guint32 encoding, guint32 rate, guint32 channels, gconstpointer data, size_t len);
67 au_write_copy(GnomeVFSHandle *to_handle, guint32 encoding, guint32 rate, guint32 channels, GnomeVFSHandle *from_handle, size_t len);
70 au_get_info(GnomeVFSHandle *handle, guint32 *format, guint32 *rate, guint32 *channels, guint32 *data_size, guint32 *data_offset);
72 gint au_copy_data(GnomeVFSHandle *to_handle, GnomeVFSHandle *from_handle, guint32 from_offset);
74 guint32 au_get_encoding(AudioFormat format);