Chris@0: Chris@0: Chris@0: Chris@0:
Chris@0:Chris@0: Chris@0: int sf_command (SNDFILE *sndfile, int cmd, void *data, int datasize) ; Chris@0:Chris@0:
Chris@0: This function allows the caller to retrieve information from or change aspects of the Chris@0: library behaviour. Chris@0: Examples include retrieving a string containing the library version or changing the Chris@0: scaling applied to floating point sample data during read and write. Chris@0: Most of these operations are performed on a per-file basis. Chris@0:
Chris@0:Chris@0: The cmd parameter is a integer identifier which is defined in <sndfile.h>. Chris@0: All of the valid command identifiers have names begining with "SFC_". Chris@0: Data is passed to and returned from the library by use of a void pointer. Chris@0: The library will not read or write more than datasize bytes from the void pointer. Chris@0: For some calls no data is required in which case data should be NULL and datasize Chris@0: may be used for some other purpose. Chris@0:
Chris@0:Chris@0: The available commands are as follows: Chris@0:
Chris@0: Chris@0:SFC_GET_LIB_VERSION | Chris@0:Retrieve the version of the library. | Chris@0:
SFC_GET_LOG_INFO | Chris@0:Retrieve the internal per-file operation log. | Chris@0:
SFC_CALC_SIGNAL_MAX | Chris@0:Retrieve the measured maximum signal value. | Chris@0:
SFC_CALC_NORM_SIGNAL_MAX | Chris@0:Retrieve the measured normalised maximum signal value. | Chris@0:
SFC_CALC_MAX_ALL_CHANNELS | Chris@0:Calculate peaks for all channels. | Chris@0:
SFC_CALC_NORM_MAX_ALL_CHANNELS | Chris@0:Calculate normalised peaks for all channels. | Chris@0:
SFC_SET_NORM_FLOAT | Chris@0:Modify the normalisation behaviour of the floating point reading and writing functions. | Chris@0:
SFC_SET_NORM_DOUBLE | Chris@0:Modify the normalisation behaviour of the double precision floating point reading and writing functions. | Chris@0:
SFC_GET_NORM_FLOAT | Chris@0:Retrieve the current normalisation behaviour of the floating point reading and writing functions. | Chris@0:
SFC_GET_NORM_DOUBLE | Chris@0:Retrieve the current normalisation behaviour of the double precision floating point reading and writing functions. | Chris@0:
SFC_GET_SIMPLE_FORMAT_COUNT | Chris@0:Retrieve the number of simple formats supported by libsndfile. | Chris@0:
SFC_GET_SIMPLE_FORMAT | Chris@0:Retrieve information about a simple format. | Chris@0:
SFC_GET_FORMAT_INFO | Chris@0:Retrieve information about a major or subtype format. | Chris@0:
SFC_GET_FORMAT_MAJOR_COUNT | Chris@0:Retrieve the number of major formats. | Chris@0:
SFC_GET_FORMAT_MAJOR | Chris@0:Retrieve information about a major format type. | Chris@0:
SFC_GET_FORMAT_SUBTYPE_COUNT | Chris@0:Retrieve the number of subformats. | Chris@0:
SFC_GET_FORMAT_SUBTYPE | Chris@0:Retrieve information about a subformat. | Chris@0:
SFC_SET_ADD_PEAK_CHUNK | Chris@0:Switch the code for adding the PEAK chunk to WAV and AIFF files on or off. | Chris@0:
SFC_UPDATE_HEADER_NOW | Chris@0:Used when a file is open for write, this command will update the file Chris@0: header to reflect the data written so far. | Chris@0:
SFC_SET_UPDATE_HEADER_AUTO | Chris@0:Used when a file is open for write, this command will cause the file header Chris@0: to be updated after each write to the file. | Chris@0:
SFC_FILE_TRUNCATE | Chris@0:Truncate a file open for write or for read/write. | Chris@0:
SFC_SET_RAW_START_OFFSET | Chris@0:Change the data start offset for files opened up as SF_FORMAT_RAW. | Chris@0:
Chris@0: Retrieve the version of the library as a string. Chris@0:
Chris@0:Chris@0: Parameters: Chris@0:
Chris@0: sndfile : Not used Chris@0: cmd : SFC_GET_LIB_VERSION Chris@0: data : A pointer to a char buffer Chris@0: datasize : The size of the the buffer Chris@0:Chris@0:
Chris@0: Example: Chris@0:
Chris@0:Chris@0: char buffer [128] ; Chris@0: sf_command (NULL, SFC_GET_LIB_VERSION, buffer, sizeof (buffer)) ; Chris@0:Chris@0: Chris@0:
Chris@0: Retrieve the log buffer generated when opening a file as a string. This log Chris@0: buffer can often contain a good reason for why libsndfile failed to open a Chris@0: particular file. Chris@0:
Chris@0:Chris@0: Parameters: Chris@0:
Chris@0: sndfile : A valid SNDFILE* pointer Chris@0: cmd : SFC_GET_LOG_INFO Chris@0: data : A pointer to a char buffer Chris@0: datasize : The size of the the buffer Chris@0:Chris@0:
Chris@0: Example: Chris@0:
Chris@0:Chris@0: char buffer [2048] ; Chris@0: sf_command (sndfile, SFC_GET_LOG_INFO, buffer, sizeof (buffer)) ; Chris@0:Chris@0: Chris@0:
Chris@0: Retrieve the measured maximum signal value. This involves reading through Chris@0: the whole file which can be slow on large files. Chris@0:
Chris@0:Chris@0: Parameters: Chris@0:
Chris@0: sndfile : A valid SNDFILE* pointer Chris@0: cmd : SFC_CALC_SIGNAL_MAX Chris@0: data : A pointer to a double Chris@0: datasize : sizeof (double) Chris@0:Chris@0:
Chris@0: Example: Chris@0:
Chris@0:Chris@0: double max_val ; Chris@0: sf_command (sndfile, SFC_CALC_SIGNAL_MAX, &max_val, sizeof (max_val)) ; Chris@0:Chris@0: Chris@0:
Chris@0: Retrieve the measured normailised maximum signal value. This involves reading Chris@0: through the whole file which can be slow on large files. Chris@0:
Chris@0:Chris@0: Parameters: Chris@0:
Chris@0: sndfile : A valid SNDFILE* pointer Chris@0: cmd : SFC_CALC_NORM_SIGNAL_MAX Chris@0: data : A pointer to a double Chris@0: datasize : sizeof (double) Chris@0:Chris@0:
Chris@0: Example: Chris@0:
Chris@0:Chris@0: double max_val ; Chris@0: sf_command (sndfile, SFC_CALC_NORM_SIGNAL_MAX, &max_val, sizeof (max_val)) ; Chris@0:Chris@0: Chris@0:
Chris@0: Calculate peaks for all channels. This involves reading through Chris@0: the whole file which can be slow on large files. Chris@0:
Chris@0:Chris@0: Parameters: Chris@0:
Chris@0: sndfile : A valid SNDFILE* pointer Chris@0: cmd : SFC_CALC_MAX_ALL_CHANNELS Chris@0: data : A pointer to a double Chris@0: datasize : sizeof (double) * number_of_channels Chris@0:Chris@0:
Chris@0: Example: Chris@0:
Chris@0:Chris@0: double peaks [number_of_channels] ; Chris@0: sf_command (sndfile, SFC_CALC_MAX_ALL_CHANNELS, peaks, sizeof (peaks)) ; Chris@0:Chris@0:
Chris@0: Calculate normalised peaks for all channels. This involves reading through Chris@0: the whole file which can be slow on large files. Chris@0:
Chris@0:Chris@0: Parameters: Chris@0:
Chris@0: sndfile : A valid SNDFILE* pointer Chris@0: cmd : SFC_CALC_NORM_MAX_ALL_CHANNELS Chris@0: data : A pointer to a double Chris@0: datasize : sizeof (double) * number_of_channels Chris@0:Chris@0:
Chris@0: Example: Chris@0:
Chris@0:Chris@0: double peaks [number_of_channels] ; Chris@0: sf_command (sndfile, SFC_CALC_NORM_MAX_ALL_CHANNELS, peaks, sizeof (peaks)) ; Chris@0:Chris@0:
Chris@0: This command only affects data read from or written to using the floating point functions: Chris@0:
Chris@0:Chris@0: size_t sf_read_float (SNDFILE *sndfile, float *ptr, size_t items) ; Chris@0: size_t sf_readf_float (SNDFILE *sndfile, float *ptr, size_t frames) ; Chris@0: Chris@0: size_t sf_write_float (SNDFILE *sndfile, float *ptr, size_t items) ; Chris@0: size_t sf_writef_float (SNDFILE *sndfile, float *ptr, size_t frames) ; Chris@0:Chris@0:
Chris@0: Parameters: Chris@0:
Chris@0:Chris@0: sndfile : A valid SNDFILE* pointer Chris@0: cmd : SFC_SET_NORM_FLOAT Chris@0: data : NULL Chris@0: datasize : SF_TRUE or SF_FALSE Chris@0:Chris@0:
Chris@0: For read operations setting normalisation to SF_TRUE means that the data from all Chris@0: subsequent reads will be be normalised to the range [-1.0, 1.0]. Chris@0:
Chris@0:Chris@0: For write operations, setting normalisation to SF_TRUE means than all data supplied Chris@0: to the float write functions should be in the range [-1.0, 1.0] and will be scaled Chris@0: for the file format as necessary. Chris@0:
Chris@0:Chris@0: For both cases, setting normalisation to SF_FALSE means that no scaling will take place. Chris@0:
Chris@0:Chris@0: Example: Chris@0:
Chris@0:Chris@0: sf_command (sndfile, SFC_SET_NORM_FLOAT, NULL, SF_TRUE) ; Chris@0: Chris@0: sf_command (sndfile, SFC_SET_NORM_FLOAT, NULL, SF_FALSE) ; Chris@0:Chris@0:
Chris@0: This command only affects data read from or written to using the double precision Chris@0: floating point functions: Chris@0:
Chris@0:Chris@0: size_t sf_read_double (SNDFILE *sndfile, double *ptr, size_t items) ; Chris@0: size_t sf_readf_double (SNDFILE *sndfile, double *ptr, size_t frames) ; Chris@0: Chris@0: size_t sf_write_double (SNDFILE *sndfile, double *ptr, size_t items) ; Chris@0: size_t sf_writef_double (SNDFILE *sndfile, double *ptr, size_t frames) ; Chris@0:Chris@0:
Chris@0: Parameters: Chris@0:
Chris@0:Chris@0: sndfile : A valid SNDFILE* pointer Chris@0: cmd : SFC_SET_NORM_DOUBLE Chris@0: data : NULL Chris@0: datasize : SF_TRUE or SF_FALSE Chris@0:Chris@0:
Chris@0: For read operations setting normalisation to SF_TRUE means that the data Chris@0: from all subsequent reads will be be normalised to the range [-1.0, 1.0]. Chris@0:
Chris@0:Chris@0: For write operations, setting normalisation to SF_TRUE means than all data supplied Chris@0: to the double write functions should be in the range [-1.0, 1.0] and will be scaled Chris@0: for the file format as necessary. Chris@0:
Chris@0:Chris@0: For both cases, setting normalisation to SF_FALSE means that no scaling will take place. Chris@0:
Chris@0:Chris@0: Example: Chris@0:
Chris@0:Chris@0: sf_command (sndfile, SFC_SET_NORM_DOUBLE, NULL, SF_TRUE) ; Chris@0: Chris@0: sf_command (sndfile, SFC_SET_NORM_DOUBLE, NULL, SF_FALSE) ; Chris@0:Chris@0:
Chris@0: Retrieve the current float normalisation mode. Chris@0:
Chris@0:Chris@0: Parameters: Chris@0:
Chris@0:Chris@0: sndfile : A valid SNDFILE* pointer Chris@0: cmd : SFC_GET_NORM_FLOAT Chris@0: data : NULL Chris@0: datasize : anything Chris@0:Chris@0:
Chris@0: Example: Chris@0:
Chris@0:Chris@0: normalisation = sf_command (sndfile, SFC_GET_NORM_FLOAT, NULL, 0) ; Chris@0:Chris@0:
Chris@0: Retrieve the current float normalisation mode. Chris@0:
Chris@0:Chris@0: Parameters: Chris@0:
Chris@0:Chris@0: sndfile : A valid SNDFILE* pointer Chris@0: cmd : SFC_GET_NORM_DOUBLE Chris@0: data : NULL Chris@0: datasize : anything Chris@0:Chris@0:
Chris@0: Example: Chris@0:
Chris@0:Chris@0: normalisation = sf_command (sndfile, SFC_GET_NORM_DOUBLE, NULL, 0) ; Chris@0:Chris@0:
Chris@0: Retrieve the number of simple formats supported by libsndfile. Chris@0:
Chris@0:Chris@0: Parameters: Chris@0:
Chris@0:Chris@0: sndfile : Not used. Chris@0: cmd : SFC_GET_SIMPLE_FORMAT_COUNT Chris@0: data : a pointer to an int Chris@0: datasize : sizeof (int) Chris@0:Chris@0:
Chris@0: Example: Chris@0:
Chris@0:Chris@0: int count ; Chris@0: sf_command (sndfile, SFC_GET_SIMPLE_FORMAT_COUNT, &count, sizeof (int)) ; Chris@0:Chris@0:
Chris@0: Retrieve information about a simple format. Chris@0:
Chris@0:Chris@0: Parameters: Chris@0:
Chris@0:Chris@0: sndfile : Not used. Chris@0: cmd : SFC_GET_SIMPLE_FORMAT Chris@0: data : a pointer to an SF_FORMAT_INFO struct Chris@0: datasize : sizeof (SF_FORMAT_INFO) Chris@0:Chris@0:
Chris@0: The SF_FORMAT_INFO struct is defined in <sndfile.h> as: Chris@0:
Chris@0:Chris@0: typedef struct Chris@0: { int format ; Chris@0: const char *name ; Chris@0: const char *extension ; Chris@0: } SF_FORMAT_INFO ; Chris@0:Chris@0:
Chris@0: When sf_command() is called with SF_GET_SIMPLE_FORMAT, the value of the format Chris@0: field should be the format number (ie 0 <= format <= count value obtained using Chris@0: SF_GET_SIMPLE_FORMAT_COUNT). Chris@0:
Chris@0:Chris@0: Example: Chris@0:
Chris@0:Chris@0: SF_FORMAT_INFO format_info ; Chris@0: int k, count ; Chris@0: Chris@0: sf_command (sndfile, SFC_GET_SIMPLE_FORMAT_COUNT, &count, sizeof (int)) ; Chris@0: Chris@0: for (k = 0 ; k < count ; k++) Chris@0: { format_info.format = k ; Chris@0: sf_command (sndfile, SFC_GET_SIMPLE_FORMAT, &format_info, sizeof (format_info)) ; Chris@0: printf ("%08x %s %s\n", format_info.format, format_info.name, format_info.extension) ; Chris@0: } ; Chris@0:Chris@0:
Chris@0: Retrieve information about a major or subtype format. Chris@0:
Chris@0:Chris@0: Parameters: Chris@0:
Chris@0:Chris@0: sndfile : Not used. Chris@0: cmd : SFC_GET_FORMAT_INFO Chris@0: data : a pointer to an SF_FORMAT_INFO struct Chris@0: datasize : sizeof (SF_FORMAT_INFO) Chris@0:Chris@0:
Chris@0: The SF_FORMAT_INFO struct is defined in <sndfile.h> as: Chris@0:
Chris@0:Chris@0: typedef struct Chris@0: { int format ; Chris@0: const char *name ; Chris@0: const char *extension ; Chris@0: } SF_FORMAT_INFO ; Chris@0:Chris@0:
Chris@0: When sf_command() is called with SF_GET_FORMAT_INFO, the format field is Chris@0: examined and if (format & SF_FORMAT_TYPEMASK) is a valid format then the struct Chris@0: is filled in with information about the given major type. Chris@0: If (format & SF_FORMAT_TYPEMASK) is FALSE and (format & SF_FORMAT_SUBMASK) is a Chris@0: valid subtype format then the struct is filled in with information about the given Chris@0: subtype. Chris@0:
Chris@0:Chris@0: Example: Chris@0:
Chris@0:Chris@0: SF_FORMAT_INFO format_info ; Chris@0: Chris@0: format_info.format = SF_FORMAT_WAV ; Chris@0: sf_command (sndfile, SFC_GET_FORMAT_INFO, &format_info, sizeof (format_info)) ; Chris@0: printf ("%08x %s %s\n", format_info.format, format_info.name, format_info.extension) ; Chris@0: Chris@0: format_info.format = SF_FORMAT_ULAW ; Chris@0: sf_command (sndfile, SFC_GET_FORMAT_INFO, &format_info, sizeof (format_info)) ; Chris@0: printf ("%08x %s\n", format_info.format, format_info.name) ; Chris@0:Chris@0:
Chris@0: Retrieve the number of major formats. Chris@0:
Chris@0:Chris@0: Parameters: Chris@0:
Chris@0:Chris@0: sndfile : Not used. Chris@0: cmd : SFC_GET_FORMAT_MAJOR_COUNT Chris@0: data : a pointer to an int Chris@0: datasize : sizeof (int) Chris@0:Chris@0:
Chris@0: Example: Chris@0:
Chris@0:Chris@0: int count ; Chris@0: sf_command (sndfile, SFC_GET_FORMAT_MAJOR_COUNT, &count, sizeof (int)) ; Chris@0:Chris@0:
Chris@0: Retrieve information about a major format type. Chris@0:
Chris@0:Chris@0: Parameters: Chris@0:
Chris@0:Chris@0: sndfile : Not used. Chris@0: cmd : SFC_GET_FORMAT_MAJOR Chris@0: data : a pointer to an SF_FORMAT_INFO struct Chris@0: datasize : sizeof (SF_FORMAT_INFO) Chris@0:Chris@0:
Chris@0: Example: Chris@0:
Chris@0:Chris@0: SF_FORMAT_INFO format_info ; Chris@0: int k, count ; Chris@0: Chris@0: sf_command (sndfile, SFC_GET_FORMAT_MAJOR_COUNT, &count, sizeof (int)) ; Chris@0: Chris@0: for (k = 0 ; k < count ; k++) Chris@0: { format_info.format = k ; Chris@0: sf_command (sndfile, SFC_GET_FORMAT_MAJOR, &format_info, sizeof (format_info)) ; Chris@0: printf ("%08x %s %s\n", format_info.format, format_info.name, format_info.extension) ; Chris@0: } ; Chris@0:Chris@0:
Chris@0: For a more comprehensive example, see the program list_formats.c in the examples/ Chris@0: directory of the libsndfile source code distribution. Chris@0:
Chris@0:Chris@0: Retrieve the number of subformats. Chris@0:
Chris@0:Chris@0: Parameters: Chris@0:
Chris@0:Chris@0: sndfile : Not used. Chris@0: cmd : SFC_GET_FORMAT_SUBTYPE_COUNT Chris@0: data : a pointer to an int Chris@0: datasize : sizeof (int) Chris@0:Chris@0:
Chris@0: Example: Chris@0:
Chris@0:Chris@0: int count ; Chris@0: sf_command (sndfile, SFC_GET_FORMAT_SUBTYPE_COUNT, &count, sizeof (int)) ; Chris@0:Chris@0:
Chris@0: Retrieve information about a subformat. Chris@0:
Chris@0:Chris@0: Parameters: Chris@0:
Chris@0:Chris@0: sndfile : Not used. Chris@0: cmd : SFC_GET_FORMAT_SUBTYPE Chris@0: data : a pointer to an SF_FORMAT_INFO struct Chris@0: datasize : sizeof (SF_FORMAT_INFO) Chris@0:Chris@0:
Chris@0: Example: Chris@0:
Chris@0:Chris@0: SF_FORMAT_INFO format_info ; Chris@0: int k, count ; Chris@0: Chris@0: sf_command (sndfile, SFC_GET_FORMAT_SUBTYPE_COUNT, &count, sizeof (int)) ; Chris@0: Chris@0: /* Retrieve all the subtypes supported by the WAV format. */ Chris@0: for (k = 0 ; k < count ; k++) Chris@0: { format_info.format = k ; Chris@0: sf_command (sndfile, SFC_GET_FORMAT_SUBTYPE, &format_info, sizeof (format_info)) ; Chris@0: if (! sf_format_check (format.info | SF_FORMAT_WAV)) Chris@0: continue ; Chris@0: printf ("%08x %s\n", format_info.format, format_info.name) ; Chris@0: } ; Chris@0:Chris@0:
Chris@0: For a more comprehensive example, see the program list_formats.c in the examples/ Chris@0: directory of the libsndfile source code distribution. Chris@0:
Chris@0:Chris@0: By default, WAV and AIFF files which contain floating point data (subtype SF_FORMAT_FLOAT Chris@0: or SF_FORMAT_DOUBLE) have a PEAK chunk. Chris@0: By using this command, the addition of a PEAK chunk can be turned on or off. Chris@0:
Chris@0:Chris@0: Note : This call must be made before any data is written to the file. Chris@0:
Chris@0:Chris@0: Parameters: Chris@0:
Chris@0: sndfile : A valid SNDFILE* pointer Chris@0: cmd : SFC_SET_ADD_PEAK_CHUNK Chris@0: data : Not used (should be NULL) Chris@0: datasize : TRUE or FALSE. Chris@0:Chris@0:
Chris@0: Example: Chris@0:
Chris@0:Chris@0: /* Turn on the PEAK chunk. */ Chris@0: sf_command (sndfile, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_TRUE) ; Chris@0: Chris@0: /* Turn off the PEAK chunk. */ Chris@0: sf_command (sndfile, SFC_SET_ADD_PEAK_CHUNK, NULL, SF_FALSE) ; Chris@0:Chris@0:
Chris@0: The header of an audio file is normally written by libsndfile when the file is Chris@0: closed using sf_close(). Chris@0:
Chris@0:Chris@0: There are however situations where large files are being generated and it would Chris@0: be nice to have valid data in the header before the file is complete. Chris@0: Using this command will update the file header to reflect the amount of data written Chris@0: to the file so far. Chris@0: Other programs opening the file for read (before any more data is written) will Chris@0: then read a valid sound file header. Chris@0:
Chris@0:Chris@0: Parameters: Chris@0:
Chris@0: sndfile : A valid SNDFILE* pointer Chris@0: cmd : SFC_UPDATE_HEADER_NOW Chris@0: data : Not used (should be NULL) Chris@0: datasize : Not used. Chris@0:Chris@0:
Chris@0: Example: Chris@0:
Chris@0:Chris@0: /* Update the header now. */ Chris@0: sf_command (sndfile, SFC_UPDATE_HEADER_NOW, NULL, 0) ; Chris@0:Chris@0:
Chris@0: Similar to SFC_UPDATE_HEADER_NOW but updates the header at the end of every call Chris@0: to the sf_write* functions. Chris@0:
Chris@0:Chris@0: Parameters: Chris@0:
Chris@0: sndfile : A valid SNDFILE* pointer Chris@0: cmd : SFC_UPDATE_HEADER_NOW Chris@0: data : Not used (should be NULL) Chris@0: datasize : SF_TRUE or SF_FALSE Chris@0:Chris@0:
Chris@0: Example: Chris@0:
Chris@0:Chris@0: /* Turn on auto header update. */ Chris@0: sf_command (sndfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_TRUE) ; Chris@0: Chris@0: /* Turn off auto header update. */ Chris@0: sf_command (sndfile, SFC_SET_UPDATE_HEADER_AUTO, NULL, SF_FALSE) ; Chris@0:Chris@0:
Chris@0: Truncate a file open for write or for read/write. Chris@0:
Chris@0:Chris@0: Parameters: Chris@0:
Chris@0: sndfile : A valid SNDFILE* pointer Chris@0: cmd : SFC_FILE_TRUNCATE Chris@0: data : A pointer to an sf_count_t. Chris@0: datasize : sizeof (sf_count_t) Chris@0:Chris@0: Chris@0:
Chris@0: Truncate the file to the number of frames specified by the sf_count_t pointed Chris@0: to by data. Chris@0: After this command, both the read and the write pointer will be Chris@0: at the new end of the file. Chris@0: This command will fail (returning non-zero) if the requested truncate position Chris@0: is beyond the end of the file. Chris@0:
Chris@0:Chris@0: Example: Chris@0:
Chris@0:Chris@0: /* Truncate the file to a length of 20 frames. */ Chris@0: sf_count_t frames = 20 ; Chris@0: sf_command (sndfile, SFC_FILE_TRUNCATE, &frames, sizeof (frames)) ; Chris@0:Chris@0:
Chris@0: Change the data start offset for files opened up as SF_FORMAT_RAW. Chris@0:
Chris@0:Chris@0: Parameters: Chris@0:
Chris@0: sndfile : A valid SNDFILE* pointer Chris@0: cmd : SFC_SET_RAW_START_OFFSET Chris@0: data : A pointer to an sf_count_t. Chris@0: datasize : sizeof (sf_count_t) Chris@0:Chris@0: Chris@0:
Chris@0: For a file opened as format SF_FORMAT_RAW, set the data offset to the value Chris@0: given by data. Chris@0:
Chris@0:Chris@0: Example: Chris@0:
Chris@0:Chris@0: /* Reset the data offset to 5 bytes from the start of the file. */ Chris@0: sf_count_t offset = 5 ; Chris@0: sf_command (sndfile, SFC_SET_RAW_START_OFFSET, &offset, sizeof (offset)) ; Chris@0:Chris@0:
Chris@0: The libsndfile home page is here :
Chris@0:
Chris@0: http://www.mega-nerd.com/libsndfile/.
Chris@0:
Chris@0: Version : 1.0.25
Chris@0: