sndfile2k
1.2.0
|
SndFile2K C API reference. More...
#include <stdio.h>
#include <stdint.h>
#include <sys/types.h>
#include "sndfile2k_export.h"
Go to the source code of this file.
Data Structures | |
struct | SF_INFO |
Contains information about format of sound file. More... | |
struct | SF_FORMAT_INFO |
Contains information about the sound file format. More... | |
struct | SF_DITHER_INFO |
Contains information about dithering. More... | |
struct | SF_EMBED_FILE_INFO |
Contains information about embedded file. More... | |
struct | SF_CUE_POINT |
Contains CUE marker information. More... | |
struct | SF_INSTRUMENT |
Contains instrument information. More... | |
struct | SF_LOOP_INFO |
Defines loop information. More... | |
struct | SF_CART_TIMER |
Contanins information about CART timer. More... | |
struct | SF_VIRTUAL_IO |
Defines virtual file I/O context. More... | |
struct | SF_CHUNK_INFO |
Describes sound file chunk. More... | |
Macros | |
#define | SNDFILE2K_H |
#define | SNDFILE_1 |
#define | SF_STR_FIRST SF_STR_TITLE |
Defines start index of of tags fields. | |
#define | SF_STR_LAST SF_STR_GENRE |
Defines last index of of tags fields. | |
#define | SF_COUNT_MAX INT64_MAX |
Defines maximum value of sf_count_t. | |
#define | SF_CUES_VAR(count) |
Defines struct containing desired count of CUE markers. More... | |
#define | SF_BROADCAST_INFO_VAR(coding_hist_size) |
#define | SF_CART_INFO_VAR(p_tag_text_size) |
Defines CART timer struct with tag_text of desired size. More... | |
Typedefs | |
typedef struct sf_private_tag | SNDFILE |
Represents opened sound file. More... | |
typedef int64_t | sf_count_t |
Represents file offset type. More... | |
typedef unsigned long(* | sf_ref_callback) (void *user_data) |
Type of user defined function that increases reference count. More... | |
typedef void(* | sf_unref_callback) (void *user_data) |
Type of user defined function that decreases reference count. More... | |
typedef sf_count_t(* | sf_vio_get_filelen) (void *user_data) |
Type of user defined function that returns file size. More... | |
typedef sf_count_t(* | sf_vio_seek) (sf_count_t offset, int whence, void *user_data) |
Type of user defined seek function. More... | |
typedef sf_count_t(* | sf_vio_read) (void *ptr, sf_count_t count, void *user_data) |
Type of user defined read function. More... | |
typedef sf_count_t(* | sf_vio_write) (const void *ptr, sf_count_t count, void *user_data) |
Type of user defined write function. More... | |
typedef sf_count_t(* | sf_vio_tell) (void *user_data) |
Type of user defined function that returns current position in file. More... | |
typedef void(* | sf_vio_flush) (void *user_data) |
Type of user defined function that forces the writing of data to disk. More... | |
typedef int(* | sf_vio_set_filelen) (void *user_data, sf_count_t len) |
Type of user defined function truncates stream size. More... | |
typedef SF_BOOL(* | sf_vio_is_pipe) (void *user_data) |
Type of user defined function indicates pipe mode. More... | |
typedef struct SF_CHUNK_ITERATOR | SF_CHUNK_ITERATOR |
An opaque structure to an iterator over the all chunks of a given id. | |
Enumerations | |
enum | SF_FORMAT { SF_FORMAT_WAV = 0x010000, SF_FORMAT_AIFF = 0x020000, SF_FORMAT_AU = 0x030000, SF_FORMAT_RAW = 0x040000, SF_FORMAT_PAF = 0x050000, SF_FORMAT_SVX = 0x060000, SF_FORMAT_NIST = 0x070000, SF_FORMAT_VOC = 0x080000, SF_FORMAT_IRCAM = 0x0A0000, SF_FORMAT_W64 = 0x0B0000, SF_FORMAT_MAT4 = 0x0C0000, SF_FORMAT_MAT5 = 0x0D0000, SF_FORMAT_PVF = 0x0E0000, SF_FORMAT_XI = 0x0F0000, SF_FORMAT_HTK = 0x100000, SF_FORMAT_SDS = 0x110000, SF_FORMAT_AVR = 0x120000, SF_FORMAT_WAVEX = 0x130000, SF_FORMAT_SD2 = 0x160000, SF_FORMAT_FLAC = 0x170000, SF_FORMAT_CAF = 0x180000, SF_FORMAT_WVE = 0x190000, SF_FORMAT_OGG = 0x200000, SF_FORMAT_MPC2K = 0x210000, SF_FORMAT_RF64 = 0x220000, SF_FORMAT_PCM_S8 = 0x0001, SF_FORMAT_PCM_16 = 0x0002, SF_FORMAT_PCM_24 = 0x0003, SF_FORMAT_PCM_32 = 0x0004, SF_FORMAT_PCM_U8 = 0x0005, SF_FORMAT_FLOAT = 0x0006, SF_FORMAT_DOUBLE = 0x0007, SF_FORMAT_ULAW = 0x0010, SF_FORMAT_ALAW = 0x0011, SF_FORMAT_IMA_ADPCM = 0x0012, SF_FORMAT_MS_ADPCM = 0x0013, SF_FORMAT_GSM610 = 0x0020, SF_FORMAT_VOX_ADPCM = 0x0021, SF_FORMAT_NMS_ADPCM_16 = 0x0022, SF_FORMAT_NMS_ADPCM_24 = 0x0023, SF_FORMAT_NMS_ADPCM_32 = 0x0024, SF_FORMAT_G721_32 = 0x0030, SF_FORMAT_G723_24 = 0x0031, SF_FORMAT_G723_40 = 0x0032, SF_FORMAT_DWVW_12 = 0x0040, SF_FORMAT_DWVW_16 = 0x0041, SF_FORMAT_DWVW_24 = 0x0042, SF_FORMAT_DWVW_N = 0x0043, SF_FORMAT_DPCM_8 = 0x0050, SF_FORMAT_DPCM_16 = 0x0051, SF_FORMAT_VORBIS = 0x0060, SF_FORMAT_ALAC_16 = 0x0070, SF_FORMAT_ALAC_20 = 0x0071, SF_FORMAT_ALAC_24 = 0x0072, SF_FORMAT_ALAC_32 = 0x0073, SF_ENDIAN_FILE = 0x00000000, SF_ENDIAN_LITTLE = 0x10000000, SF_ENDIAN_BIG = 0x20000000, SF_ENDIAN_CPU = 0x30000000, SF_FORMAT_SUBMASK = 0x0000FFFF, SF_FORMAT_TYPEMASK = 0x0FFF0000, SF_FORMAT_ENDMASK = 0xF0000000 } |
Set of format bit flags. More... | |
enum | SF_COMMAND { SFC_GET_LIB_VERSION = 0x1000, SFC_GET_LOG_INFO = 0x1001, SFC_GET_CURRENT_SF_INFO = 0x1002, SFC_GET_NORM_DOUBLE = 0x1010, SFC_GET_NORM_FLOAT = 0x1011, SFC_SET_NORM_DOUBLE = 0x1012, SFC_SET_NORM_FLOAT = 0x1013, SFC_SET_SCALE_FLOAT_INT_READ = 0x1014, SFC_SET_SCALE_INT_FLOAT_WRITE = 0x1015, SFC_GET_SIMPLE_FORMAT_COUNT = 0x1020, SFC_GET_SIMPLE_FORMAT = 0x1021, SFC_GET_FORMAT_INFO = 0x1028, SFC_GET_FORMAT_MAJOR_COUNT = 0x1030, SFC_GET_FORMAT_MAJOR = 0x1031, SFC_GET_FORMAT_SUBTYPE_COUNT = 0x1032, SFC_GET_FORMAT_SUBTYPE = 0x1033, SFC_CALC_SIGNAL_MAX = 0x1040, SFC_CALC_NORM_SIGNAL_MAX = 0x1041, SFC_CALC_MAX_ALL_CHANNELS = 0x1042, SFC_CALC_NORM_MAX_ALL_CHANNELS = 0x1043, SFC_GET_SIGNAL_MAX = 0x1044, SFC_GET_MAX_ALL_CHANNELS = 0x1045, SFC_SET_ADD_PEAK_CHUNK = 0x1050, SFC_SET_ADD_HEADER_PAD_CHUNK = 0x1051, SFC_UPDATE_HEADER_NOW = 0x1060, SFC_SET_UPDATE_HEADER_AUTO = 0x1061, SFC_FILE_TRUNCATE = 0x1080, SFC_SET_RAW_START_OFFSET = 0x1090, SFC_SET_DITHER_ON_WRITE = 0x10A0, SFC_SET_DITHER_ON_READ = 0x10A1, SFC_GET_DITHER_INFO_COUNT = 0x10A2, SFC_GET_DITHER_INFO = 0x10A3, SFC_GET_EMBED_FILE_INFO = 0x10B0, SFC_SET_CLIPPING = 0x10C0, SFC_GET_CLIPPING = 0x10C1, SFC_GET_CUE_COUNT = 0x10CD, SFC_GET_CUE = 0x10CE, SFC_SET_CUE = 0x10CF, SFC_GET_INSTRUMENT = 0x10D0, SFC_SET_INSTRUMENT = 0x10D1, SFC_GET_LOOP_INFO = 0x10E0, SFC_GET_BROADCAST_INFO = 0x10F0, SFC_SET_BROADCAST_INFO = 0x10F1, SFC_GET_CHANNEL_MAP_INFO = 0x1100, SFC_SET_CHANNEL_MAP_INFO = 0x1101, SFC_RAW_DATA_NEEDS_ENDSWAP = 0x1110, SFC_WAVEX_SET_AMBISONIC = 0x1200, SFC_WAVEX_GET_AMBISONIC = 0x1201, SFC_RF64_AUTO_DOWNGRADE = 0x1210, SFC_SET_VBR_ENCODING_QUALITY = 0x1300, SFC_SET_COMPRESSION_LEVEL = 0x1301, SFC_SET_CART_INFO = 0x1400, SFC_GET_CART_INFO = 0x1401, SFC_TEST_IEEE_FLOAT_REPLACE = 0x6001, SFC_SET_ADD_DITHER_ON_WRITE = 0x1070, SFC_SET_ADD_DITHER_ON_READ = 0x1071 } |
Defines command constants for sf_command() More... | |
enum | SF_STR_FIELD { SF_STR_TITLE = 0x01, SF_STR_COPYRIGHT = 0x02, SF_STR_SOFTWARE = 0x03, SF_STR_ARTIST = 0x04, SF_STR_COMMENT = 0x05, SF_STR_DATE = 0x06, SF_STR_ALBUM = 0x07, SF_STR_LICENSE = 0x08, SF_STR_TRACKNUMBER = 0x09, SF_STR_GENRE = 0x10 } |
Defines field type constants. More... | |
enum | SF_BOOL { SF_FALSE = 0, SF_TRUE = 1 } |
Defines boolean constants. More... | |
enum | SF_FILEMODE { SFM_READ = 0x10, SFM_WRITE = 0x20, SFM_RDWR = 0x30 } |
Defines the kind of file access. More... | |
enum | SF_AMBISONIC_MODE { SF_AMBISONIC_NONE = 0x40, SF_AMBISONIC_B_FORMAT = 0x41 } |
Defines Ambisonics format constants. More... | |
enum | SF_ERR { SF_ERR_NO_ERROR = 0, SF_ERR_UNRECOGNISED_FORMAT = 1, SF_ERR_SYSTEM = 2, SF_ERR_MALFORMED_FILE = 3, SF_ERR_UNSUPPORTED_ENCODING = 4 } |
Defines public error values. More... | |
enum | SF_CHANNEL_MAP { SF_CHANNEL_MAP_INVALID = 0, SF_CHANNEL_MAP_MONO = 1, SF_CHANNEL_MAP_LEFT, SF_CHANNEL_MAP_RIGHT, SF_CHANNEL_MAP_CENTER, SF_CHANNEL_MAP_FRONT_LEFT, SF_CHANNEL_MAP_FRONT_RIGHT, SF_CHANNEL_MAP_FRONT_CENTER, SF_CHANNEL_MAP_REAR_CENTER, SF_CHANNEL_MAP_REAR_LEFT, SF_CHANNEL_MAP_REAR_RIGHT, SF_CHANNEL_MAP_LFE, SF_CHANNEL_MAP_FRONT_LEFT_OF_CENTER, SF_CHANNEL_MAP_FRONT_RIGHT_OF_CENTER, SF_CHANNEL_MAP_SIDE_LEFT, SF_CHANNEL_MAP_SIDE_RIGHT, SF_CHANNEL_MAP_TOP_CENTER, SF_CHANNEL_MAP_TOP_FRONT_LEFT, SF_CHANNEL_MAP_TOP_FRONT_RIGHT, SF_CHANNEL_MAP_TOP_FRONT_CENTER, SF_CHANNEL_MAP_TOP_REAR_LEFT, SF_CHANNEL_MAP_TOP_REAR_RIGHT, SF_CHANNEL_MAP_TOP_REAR_CENTER, SF_CHANNEL_MAP_AMBISONIC_B_W, SF_CHANNEL_MAP_AMBISONIC_B_X, SF_CHANNEL_MAP_AMBISONIC_B_Y, SF_CHANNEL_MAP_AMBISONIC_B_Z, SF_CHANNEL_MAP_MAX } |
Defines channel map constants. | |
enum | SF_DITHER_TYPE { SFD_DEFAULT_LEVEL = 0, SFD_CUSTOM_LEVEL = 0x40000000, SFD_NO_DITHER = 500, SFD_WHITE = 501, SFD_TRIANGULAR_PDF = 502 } |
Defines dither type constants. More... | |
enum | SF_LOOP_MODE { SF_LOOP_NONE = 800, SF_LOOP_FORWARD, SF_LOOP_BACKWARD, SF_LOOP_ALTERNATING } |
Defines loop mode constants. More... | |
enum | SF_SEEK_MODE { SF_SEEK_SET = SEEK_SET, SF_SEEK_CUR = SEEK_CUR, SF_SEEK_END = SEEK_END } |
Defines file seek mode constants. More... | |
Functions | |
typedef | SF_CUES_VAR (100) SF_CUES |
Represents CUE markers struct containing maximum of 100 CUE markers. | |
typedef | SF_BROADCAST_INFO_VAR (256) SF_BROADCAST_INFO |
Defines Broadcast struct with coding_history field of 256 bytes. More... | |
typedef | SF_CART_INFO_VAR (256) SF_CART_INFO |
Declares CART timer struct with tag_text of 256 elements. More... | |
SNDFILE2K_EXPORT SNDFILE * | sf_open (const char *path, int mode, SF_INFO *sfinfo) |
Opens the specified sound file using path. More... | |
SNDFILE2K_EXPORT SNDFILE * | sf_open_fd (int fd, int mode, SF_INFO *sfinfo, int close_desc) |
Opens sound file using POSIX file descriptor. More... | |
SNDFILE2K_EXPORT SNDFILE * | sf_open_virtual (SF_VIRTUAL_IO *sfvirtual, int mode, SF_INFO *sfinfo, void *user_data) |
Opens sound file using Virtual I/O context. More... | |
SNDFILE2K_EXPORT SNDFILE * | sf_open_virtual_ex (SF_VIRTUAL_IO *sfvirtual, int mode, SF_INFO *sfinfo, void *user_data) |
Opens sound file using Virtual I/O context. More... | |
SNDFILE2K_EXPORT int | sf_error (SNDFILE *sndfile) |
Returns the current error code for the given SNDFILE. More... | |
SNDFILE2K_EXPORT const char * | sf_strerror (SNDFILE *sndfile) |
Returns textual description of the current error code for the given SNDFILE. More... | |
SNDFILE2K_EXPORT const char * | sf_error_number (int errnum) |
Returns text description of error code. More... | |
SNDFILE2K_EXPORT int | sf_perror (SNDFILE *sndfile) |
Returns internal error code for the given SNDFILE. More... | |
SNDFILE2K_EXPORT int | sf_error_str (SNDFILE *sndfile, char *str, size_t len) |
Fills provided buffer with text description of error code for the given SNDFILE. More... | |
SNDFILE2K_EXPORT int | sf_command (SNDFILE *sndfile, int command, void *data, int datasize) |
Gets or sets parameters of library or sound file. More... | |
SNDFILE2K_EXPORT int | sf_format_check (const SF_INFO *info) |
Checks correctness of SF_INFO::format field. More... | |
SNDFILE2K_EXPORT sf_count_t | sf_seek (SNDFILE *sndfile, sf_count_t frames, int whence) |
Changes position of sound file. More... | |
SNDFILE2K_EXPORT int | sf_set_string (SNDFILE *sndfile, int str_type, const char *str) |
Sets string field for given sound file. More... | |
SNDFILE2K_EXPORT const char * | sf_get_string (SNDFILE *sndfile, int str_type) |
Gets string field from given sound file. More... | |
SNDFILE2K_EXPORT const char * | sf_version_string (void) |
Returns the library version string. More... | |
SNDFILE2K_EXPORT int | sf_current_byterate (SNDFILE *sndfile) |
Returns current byterate of the file. More... | |
SNDFILE2K_EXPORT sf_count_t | sf_read_raw (SNDFILE *sndfile, void *ptr, sf_count_t bytes) |
Read raw bytes from sound file. More... | |
SNDFILE2K_EXPORT sf_count_t | sf_write_raw (SNDFILE *sndfile, const void *ptr, sf_count_t bytes) |
Writes raw bytes to sound file. More... | |
SNDFILE2K_EXPORT sf_count_t | sf_readf_short (SNDFILE *sndfile, short *ptr, sf_count_t frames) |
Reads short (16-bit) frames from file. More... | |
SNDFILE2K_EXPORT sf_count_t | sf_writef_short (SNDFILE *sndfile, const short *ptr, sf_count_t frames) |
Writes short (16-bit) frames to file. More... | |
SNDFILE2K_EXPORT sf_count_t | sf_readf_int (SNDFILE *sndfile, int *ptr, sf_count_t frames) |
Reads integer (32-bit) frames from file. More... | |
SNDFILE2K_EXPORT sf_count_t | sf_writef_int (SNDFILE *sndfile, const int *ptr, sf_count_t frames) |
Writes integer (32-bit) frames to file. More... | |
SNDFILE2K_EXPORT sf_count_t | sf_readf_float (SNDFILE *sndfile, float *ptr, sf_count_t frames) |
Reads float (32-bit) frames from file. More... | |
SNDFILE2K_EXPORT sf_count_t | sf_writef_float (SNDFILE *sndfile, const float *ptr, sf_count_t frames) |
Writes float (32-bit) frames to file. More... | |
SNDFILE2K_EXPORT sf_count_t | sf_readf_double (SNDFILE *sndfile, double *ptr, sf_count_t frames) |
Reads double (64-bit) frames from file. More... | |
SNDFILE2K_EXPORT sf_count_t | sf_writef_double (SNDFILE *sndfile, const double *ptr, sf_count_t frames) |
Writes double (64-bit) frames to file. More... | |
SNDFILE2K_EXPORT sf_count_t | sf_read_short (SNDFILE *sndfile, short *ptr, sf_count_t items) |
Reads short (16-bit) samples from file. More... | |
SNDFILE2K_EXPORT sf_count_t | sf_write_short (SNDFILE *sndfile, const short *ptr, sf_count_t items) |
Writes short (16-bit) samples to file. More... | |
SNDFILE2K_EXPORT sf_count_t | sf_read_int (SNDFILE *sndfile, int *ptr, sf_count_t items) |
Reads integer (32-bit) samples from file. More... | |
SNDFILE2K_EXPORT sf_count_t | sf_write_int (SNDFILE *sndfile, const int *ptr, sf_count_t items) |
Writes integer (32-bit) samples to file. More... | |
SNDFILE2K_EXPORT sf_count_t | sf_read_float (SNDFILE *sndfile, float *ptr, sf_count_t items) |
Reads float (32-bit) samples from file. More... | |
SNDFILE2K_EXPORT sf_count_t | sf_write_float (SNDFILE *sndfile, const float *ptr, sf_count_t items) |
Writes float (32-bit) samples to file. More... | |
SNDFILE2K_EXPORT sf_count_t | sf_read_double (SNDFILE *sndfile, double *ptr, sf_count_t items) |
Reads double (64-bit) samples from file. More... | |
SNDFILE2K_EXPORT sf_count_t | sf_write_double (SNDFILE *sndfile, const double *ptr, sf_count_t items) |
Writes double (64-bit) samples to file. More... | |
SNDFILE2K_EXPORT int | sf_close (SNDFILE *sndfile) |
Closes the SNDFILE object. More... | |
SNDFILE2K_EXPORT void | sf_write_sync (SNDFILE *sndfile) |
Forces writing of data to disk. More... | |
SNDFILE2K_EXPORT int | sf_set_chunk (SNDFILE *sndfile, const SF_CHUNK_INFO *chunk_info) |
Sets the specified chunk info. More... | |
SNDFILE2K_EXPORT SF_CHUNK_ITERATOR * | sf_get_chunk_iterator (SNDFILE *sndfile, const SF_CHUNK_INFO *chunk_info) |
Gets an iterator for all chunks matching chunk_info. More... | |
SNDFILE2K_EXPORT SF_CHUNK_ITERATOR * | sf_next_chunk_iterator (SF_CHUNK_ITERATOR *iterator) |
Iterates through chunks by incrementing the iterator. More... | |
SNDFILE2K_EXPORT int | sf_get_chunk_size (const SF_CHUNK_ITERATOR *it, SF_CHUNK_INFO *chunk_info) |
Gets the size of the specified chunk. More... | |
SNDFILE2K_EXPORT int | sf_get_chunk_data (const SF_CHUNK_ITERATOR *it, SF_CHUNK_INFO *chunk_info) |
Gets the specified chunk data. More... | |
SndFile2K C API reference.
#define SF_BROADCAST_INFO_VAR | ( | coding_hist_size | ) |
#define SF_CART_INFO_VAR | ( | p_tag_text_size | ) |
Defines CART timer struct with tag_text
of desired size.
#define SF_CUES_VAR | ( | count | ) |
Defines struct containing desired count of CUE markers.
[in] | count | Size of cue_points array |
typedef int64_t sf_count_t |
Represents file offset type.
This type is always 64-bit unsigned integer.
typedef unsigned long(* sf_ref_callback) (void *user_data) |
Type of user defined function that increases reference count.
[in] | user_data | User defined value. |
typedef void(* sf_unref_callback) (void *user_data) |
Type of user defined function that decreases reference count.
[in] | user_data | User defined value. |
typedef void(* sf_vio_flush) (void *user_data) |
Type of user defined function that forces the writing of data to disk.
[in] | user_data | User defined value. |
-
1 otherwise. typedef SF_BOOL(* sf_vio_is_pipe) (void *user_data) |
Type of user defined function indicates pipe mode.
[in] | user_data | User defined value. |
-
1 otherwise. typedef int(* sf_vio_set_filelen) (void *user_data, sf_count_t len) |
Type of user defined function truncates stream size.
[in] | user_data | User defined value. |
[in] | len | New size of stream. |
-
1 otherwise. enum SF_AMBISONIC_MODE |
enum SF_BOOL |
enum SF_DITHER_TYPE |
enum SF_FORMAT |
Set of format bit flags.
The SF_INFO::format field of the SF_INFO structure is made up of the bit-wise OR of a major format type (values between 0x10000
and 0x08000000
), a minor format type (with values less than 0x10000
) and an optional endianness value.
SF_FORMAT_SUBMASK, SF_FORMAT_TYPEMASK and SF_FORMAT_ENDMASK bit masks can be used to separate major, minor format types and endianness value.
enum SF_LOOP_MODE |
Defines loop mode constants.
Enumerator | |
---|---|
SF_LOOP_NONE | None. |
SF_LOOP_FORWARD | Forward. |
SF_LOOP_BACKWARD | Backward. |
SF_LOOP_ALTERNATING | Alternating. |
typedef SF_BROADCAST_INFO_VAR | ( | 256 | ) |
Defines Broadcast struct with coding_history
field of 256 bytes.
typedef SF_CART_INFO_VAR | ( | 256 | ) |
Declares CART timer struct with tag_text
of 256 elements.
SNDFILE2K_EXPORT int sf_close | ( | SNDFILE * | sndfile | ) |
Closes the SNDFILE object.
[in] | sndfile | Pointer to a sound file state |
SNDFILE2K_EXPORT int sf_current_byterate | ( | SNDFILE * | sndfile | ) |
Returns current byterate of the file.
[in] | sndfile | Pointer to a sound file state |
-1
otherwise. SNDFILE2K_EXPORT int sf_format_check | ( | const SF_INFO * | info | ) |
Checks correctness of SF_INFO::format field.
To open sound file in write mode you need to set up SF_INFO struct, which field SF_INFO::format is constructed as combination of major, minor format and endiannes. To be sure that format is correct and will be accepted you can use this function.
SNDFILE2K_EXPORT sf_count_t sf_read_raw | ( | SNDFILE * | sndfile, |
void * | ptr, | ||
sf_count_t | bytes | ||
) |
Read raw bytes from sound file.
[in] | sndfile | Pointer to a sound file state |
[out] | ptr | Pointer to an allocated block memory. |
[in] | bytes | Count of bytes to read |
SNDFILE2K_EXPORT const char* sf_version_string | ( | void | ) |
Returns the library version string.
X.Y.Z
format, with -exp
postfix if experimental features are enabled.) SNDFILE2K_EXPORT sf_count_t sf_write_raw | ( | SNDFILE * | sndfile, |
const void * | ptr, | ||
sf_count_t | bytes | ||
) |
Writes raw bytes to sound file.
[in] | sndfile | Pointer to a sound file state |
[in] | ptr | Pointer to an allocated block of memory. |
[in] | bytes | Count of bytes to write |