⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sndfile.h.in

📁 Audacity是一款用於錄音和編輯聲音的、免費的開放源碼軟體。它可以執行於Mac OS X、Microsoft Windows、GNU/Linux和其它作業系統
💻 IN
📖 第 1 页 / 共 2 页
字号:
#define SF_COUNT_MAX		@SF_COUNT_MAX@/* A pointer to a SF_INFO structure is passed to sf_open_read () and filled in.** On write, the SF_INFO structure is filled in by the user and passed into** sf_open_write ().*/struct SF_INFO{	sf_count_t	frames ;		/* Used to be called samples.  Changed to avoid confusion. */	int			samplerate ;	int			channels ;	int			format ;	int			sections ;	int			seekable ;} ;typedef	struct SF_INFO SF_INFO ;/* The SF_FORMAT_INFO struct is used to retrieve information about the sound** file formats libsndfile supports using the sf_command () interface.**** Using this interface will allow applications to support new file formats** and encoding types when libsndfile is upgraded, without requiring** re-compilation of the application.**** Please consult the libsndfile documentation (particularly the information** on the sf_command () interface) for examples of its use.*/typedef struct{	int			format ;	const char	*name ;	const char	*extension ;} SF_FORMAT_INFO ;/*** Enums and typedefs for adding dither on read and write.** See the html documentation for sf_command(), SFC_SET_DITHER_ON_WRITE** and SFC_SET_DITHER_ON_READ.*/enum{	SFD_DEFAULT_LEVEL	= 0,	SFD_CUSTOM_LEVEL	= 0x40000000,	SFD_NO_DITHER		= 500,	SFD_WHITE			= 501,	SFD_TRIANGULAR_PDF	= 502} ;typedef struct{	int			type ;	double		level ;	const char	*name ;} SF_DITHER_INFO ;/* Struct used to retrieve information about a file embedded within a** larger file. See SFC_GET_EMBED_FILE_INFO.*/typedef struct{	sf_count_t	offset ;	sf_count_t	length ;} SF_EMBED_FILE_INFO ;/* Struct used to retrieve music sample information from a file.*/typedef struct{	int basenote ;	int gain ;	int	sustain_mode ;	int sustain_start, sustain_end ;	int release_mode ;	int release_start, reslease_end ;} SF_INSTRUMENT ;/* sustain_mode and release_mode will be one of the following. */enum{	SF_LOOP_NONE = 800,	SF_LOOP_FORWARD,	SF_LOOP_BACKWARD} ;/* Struct used to retrieve loop information from a file.*/typedef struct{	short	time_sig_num ;	/* any positive integer    >0  */	short	time_sig_den ;	/* any positive power of 2 >0  */	int		loop_mode ;		/* see SF_LOOP enum            */	int		num_beats ;		/* this is NOT the amount of quarter notes !!!*/							/* a full bar of 4/4 is 4 beats */							/* a full bar of 7/8 is 7 beats */	float	bpm ;			/* suggestion, as it can be calculated using other fields:*/							/* file's lenght, file's sampleRate and our time_sig_den*/							/* -> bpms are always the amount of _quarter notes_ per minute */	int	root_key ;			/* MIDI note, or -1 for None */	int future [6] ;} SF_LOOP_INFO ;/* Open the specified file for read, write or both. On error, this will** return a NULL pointer. To find the error number, pass a NULL SNDFILE** to sf_perror () or sf_error_str ().** All calls to sf_open() should be matched with a call to sf_close().*/SNDFILE* 	sf_open		(const char *path, int mode, SF_INFO *sfinfo) ;/* Use the existing file descriptor to create a SNDFILE object. If close_desc** is TRUE, the file descriptor will be closed when sf_close() is called. If** it is FALSE, the descritor will not be closed.** When passed a descriptor like this, the library will assume that the start** of file header is at the current file offset. This allows sound files within** larger container files to be read and/or written.** On error, this will return a NULL pointer. To find the error number, pass a** NULL SNDFILE to sf_perror () or sf_error_str ().** All calls to sf_open_fd() should be matched with a call to sf_close().*/SNDFILE* 	sf_open_fd	(int fd, int mode, SF_INFO *sfinfo, int close_desc) ;/* sf_error () returns a error number which can be translated to a text** string using sf_error_number().*/int		sf_error		(SNDFILE *sndfile) ;/* sf_strerror () returns to the caller a pointer to the current error message for** the given SNDFILE.*/const char* sf_strerror (SNDFILE *sndfile) ;/* sf_error_number () allows the retrieval of the error string for each internal** error number.***/const char*	sf_error_number	(int errnum) ;/* The following three error functions are deprecated but they will remain in the** library for the forseeable future. The function sf_strerror() should be used** in their place.*/int		sf_perror		(SNDFILE *sndfile) ;int		sf_error_str	(SNDFILE *sndfile, char* str, size_t len) ;/* Return TRUE if fields of the SF_INFO struct are a valid combination of values. */int		sf_command	(SNDFILE *sndfile, int command, void *data, int datasize) ;/* Return TRUE if fields of the SF_INFO struct are a valid combination of values. */int		sf_format_check	(const SF_INFO *info) ;/* Seek within the waveform data chunk of the SNDFILE. sf_seek () uses** the same values for whence (SEEK_SET, SEEK_CUR and SEEK_END) as** stdio.h function fseek ().** An offset of zero with whence set to SEEK_SET will position the** read / write pointer to the first data sample.** On success sf_seek returns the current position in (multi-channel)** samples from the start of the file.** Please see the libsndfile documentation for moving the read pointer** separately from the write pointer on files open in mode SFM_RDWR.** On error all of these functions return -1.*/sf_count_t	sf_seek 		(SNDFILE *sndfile, sf_count_t frames, int whence) ;/* Functions for retrieving and setting string data within sound files.** Not all file types support this features; AIFF and WAV do. For both** functions, the str_type parameter must be one of the SF_STR_* values** defined above.** On error, sf_set_string() returns non-zero while sf_get_string()** returns NULL.*/int sf_set_string (SNDFILE *sndfile, int str_type, const char* str) ;const char* sf_get_string (SNDFILE *sndfile, int str_type) ;/* Functions for reading/writing the waveform data of a sound file.*/sf_count_t	sf_read_raw		(SNDFILE *sndfile, void *ptr, sf_count_t bytes) ;sf_count_t	sf_write_raw 	(SNDFILE *sndfile, void *ptr, sf_count_t bytes) ;/* Functions for reading and writing the data chunk in terms of frames.** The number of items actually read/written = frames * number of channels.**     sf_xxxx_raw		read/writes the raw data bytes from/to the file**     sf_xxxx_short	passes data in the native short format**     sf_xxxx_int		passes data in the native int format**     sf_xxxx_float	passes data in the native float format**     sf_xxxx_double	passes data in the native double format** All of these read/write function return number of frames read/written.*/sf_count_t	sf_readf_short	(SNDFILE *sndfile, short *ptr, sf_count_t frames) ;sf_count_t	sf_writef_short	(SNDFILE *sndfile, short *ptr, sf_count_t frames) ;sf_count_t	sf_readf_int	(SNDFILE *sndfile, int *ptr, sf_count_t frames) ;sf_count_t	sf_writef_int 	(SNDFILE *sndfile, int *ptr, sf_count_t frames) ;sf_count_t	sf_readf_float	(SNDFILE *sndfile, float *ptr, sf_count_t frames) ;sf_count_t	sf_writef_float	(SNDFILE *sndfile, float *ptr, sf_count_t frames) ;sf_count_t	sf_readf_double		(SNDFILE *sndfile, double *ptr, sf_count_t frames) ;sf_count_t	sf_writef_double	(SNDFILE *sndfile, double *ptr, sf_count_t frames) ;/* Functions for reading and writing the data chunk in terms of items.** Otherwise similar to above.** All of these read/write function return number of items read/written.*/sf_count_t	sf_read_short	(SNDFILE *sndfile, short *ptr, sf_count_t items) ;sf_count_t	sf_write_short	(SNDFILE *sndfile, short *ptr, sf_count_t items) ;sf_count_t	sf_read_int		(SNDFILE *sndfile, int *ptr, sf_count_t items) ;sf_count_t	sf_write_int 	(SNDFILE *sndfile, int *ptr, sf_count_t items) ;sf_count_t	sf_read_float	(SNDFILE *sndfile, float *ptr, sf_count_t items) ;sf_count_t	sf_write_float	(SNDFILE *sndfile, float *ptr, sf_count_t items) ;sf_count_t	sf_read_double	(SNDFILE *sndfile, double *ptr, sf_count_t items) ;sf_count_t	sf_write_double	(SNDFILE *sndfile, double *ptr, sf_count_t items) ;/* Close the SNDFILE and clean up all memory allocations associated with this** file.** Returns 0 on success, or an error number.*/int		sf_close		(SNDFILE *sndfile) ;#ifdef __cplusplus}		/* extern "C" */#endif	/* __cplusplus */#endif	/* SNDFILE_H */

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -