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