cannam@125
|
1 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
|
cannam@125
|
2 <HTML>
|
cannam@125
|
3
|
cannam@125
|
4 <HEAD>
|
cannam@125
|
5 <TITLE>
|
cannam@125
|
6 libsndfile : Embedded Sound Files.
|
cannam@125
|
7 </TITLE>
|
cannam@125
|
8 <META NAME="Author" CONTENT="Erik de Castro Lopo (erikd AT mega-nerd DOT com)">
|
cannam@125
|
9 <META NAME="Description" CONTENT="The libsndfile API.">
|
cannam@125
|
10 <META NAME="Keywords" CONTENT="WAV AIFF AU libsndfile sound audio dsp Linux">
|
cannam@125
|
11 <LINK REL="stylesheet" HREF="libsndfile.css" TYPE="text/css" MEDIA="all">
|
cannam@125
|
12 <LINK REL="stylesheet" HREF="print.css" TYPE="text/css" MEDIA="print">
|
cannam@125
|
13 </HEAD>
|
cannam@125
|
14 <!-- pepper -->
|
cannam@125
|
15 <BODY>
|
cannam@125
|
16 <!-- pepper -->
|
cannam@125
|
17 <H1><B>Embedded Sound Files.</B></H1>
|
cannam@125
|
18
|
cannam@125
|
19 <P>
|
cannam@125
|
20 By using the open SNDFILE with a file descriptor function:
|
cannam@125
|
21 </P>
|
cannam@125
|
22 <!-- pepper -->
|
cannam@125
|
23 <PRE>
|
cannam@125
|
24 SNDFILE* sf_open_fd (int fd, int mode, SF_INFO *sfinfo, int close_desc) ;
|
cannam@125
|
25 </PRE>
|
cannam@125
|
26 <!-- pepper -->
|
cannam@125
|
27 <P>
|
cannam@125
|
28 it is possible to open sound files embedded within larger files.
|
cannam@125
|
29 There are however a couple of caveats:
|
cannam@125
|
30 <P>
|
cannam@125
|
31 <!-- pepper -->
|
cannam@125
|
32 <UL>
|
cannam@125
|
33 <LI> Read/Write mode (SFM_RDWR) is not supported.
|
cannam@125
|
34 <LI> Writing of embedded files is only supported at the end of the file.
|
cannam@125
|
35 <LI> Reading of embedded files is only supported at file offsets greater
|
cannam@125
|
36 than zero.
|
cannam@125
|
37 <LI> Not all file formats are supported (currently only WAV, AIFF and AU).
|
cannam@125
|
38 </UL>
|
cannam@125
|
39 <!-- pepper -->
|
cannam@125
|
40 <P>
|
cannam@125
|
41 The test program <B>multi_file_test.c</B> in the <B>tests/</B> directory of the
|
cannam@125
|
42 source code tarball shows how this functionality is used to read and write
|
cannam@125
|
43 embedded files.
|
cannam@125
|
44 </P>
|
cannam@125
|
45 <!-- pepper -->
|
cannam@125
|
46 </BODY>
|
cannam@125
|
47 </HTML>
|