| 1 |
--- |
| 2 |
layout: page |
| 3 |
--- |
| 4 |
|
| 5 |
# Embedded Sound Files |
| 6 |
|
| 7 |
By using the open SNDFILE with a file descriptor function: |
| 8 |
|
| 9 |
SNDFILE* sf_open_fd (int fd, int mode, SF_INFO *sfinfo, int close_desc) ; |
| 10 |
|
| 11 |
it is possible to open sound files embedded within larger files. There are |
| 12 |
however a couple of caveats: |
| 13 |
|
| 14 |
* Read/Write mode (SFM_RDWR) is not supported. |
| 15 |
* Writing of embedded files is only supported at the end of the file. |
| 16 |
* Reading of embedded files is only supported at file offsets greater than zero. |
| 17 |
* Not all file formats are supported (currently only WAV, AIFF and AU). |
| 18 |
|
| 19 |
The test program **multi_file_test.c** in the **tests/** directory of the source |
| 20 |
code tarball shows how this functionality is used to read and write embedded |
| 21 |
files. |