File: sndfile.h

package info (click to toggle)
rat 4.2.20-3
  • links: PTS
  • area: main
  • in suites: woody
  • size: 2,888 kB
  • ctags: 3,655
  • sloc: ansic: 36,042; sh: 3,481; tcl: 2,740; makefile: 293
file content (67 lines) | stat: -rw-r--r-- 1,944 bytes parent folder | download | duplicates (5)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
/*
 * FILE:    sndfile.h
 * PROGRAM: RAT
 * AUTHOR:  Orion Hodson
 *
 * Copyright (c) 1998-2001 University College London
 * All rights reserved.
 *
 * $Id: sndfile.h,v 1.17 2001/01/08 20:30:09 ucaccsp Exp $
 */

#ifndef __SND_FILE_H
#define __SND_FILE_H

#ifdef __cplusplus
extern "C" {
#endif

/* The interface below allows access to Sun .au files and MS .wav files.
 *
 * The decision about which format is used depends on the extension of
 * the file name.
 *
 * The functions snd_{read,write}_open take a pointer to a pointer 
 * of type struct s_sndfile.  This makes allocation/access more
 * restrictive, but safer.
 *
 * NOTE: for snd_read_audio and snd_write_audio, buf_len is the
 * product of the number of sampling intervals to be written and
 * the number of channels.
 */

#include "sndfile_types.h"
struct s_sndfile;

int  snd_read_open (struct s_sndfile **sf, 
                    char              *path,
                    sndfile_fmt_t     *fmt);  /* fmt only used for conversion to l16 if file type is raw, maybe NULL */

int  snd_read_close (struct s_sndfile **sf);

int  snd_read_audio (struct s_sndfile **sf, 
                     sample *buf,           /* buffer                        */
                     uint16_t buf_len);     /* sampling_intervals * channels */

int  snd_write_open (struct s_sndfile **sf,
                     char         *path,
                     char         *default_extension, /* "au", or "wav", fallback if not specified */
                     const sndfile_fmt_t *fmt);

int  snd_write_close (struct s_sndfile **sf);

int  snd_write_audio (struct s_sndfile **sf, 
                      sample *buf, 
                      uint16_t buf_len);

int  snd_pause (struct s_sndfile *sf);
int  snd_resume (struct s_sndfile *sf);

int  snd_get_format(struct s_sndfile *sf, sndfile_fmt_t *fmt);

int  snd_valid_format(sndfile_fmt_t *fmt);

#ifdef __cplusplus
}
#endif
#endif /* __SND_FILE_H */