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