github.com/256dpi/max-go@v0.7.0/lib/max/ext_sndfile.h (about) 1 #ifndef _EXT_SNDFILE_H_ 2 #define _EXT_SNDFILE_H_ 3 4 #include "ext_prefix.h" 5 #include "ext_mess.h" 6 #include "ext_sysfile.h" 7 8 #ifdef __cplusplus 9 extern "C" { 10 #endif 11 12 #if C74_PRAGMA_STRUCT_PACKPUSH 13 #pragma pack(push, 2) 14 #elif C74_PRAGMA_STRUCT_PACK 15 #pragma pack(2) 16 #endif 17 18 typedef struct _sndfileinfo 19 { 20 t_int32 sr; 21 t_ptr_size length; 22 t_ptr_size sampsize; // in bytes 23 t_fourcc filetype; 24 t_uint32 comptype; 25 t_uint32 format; 26 char name[128]; 27 t_int32 byteswap; 28 t_int32 nchans; 29 t_ptr_size frames; 30 void *inst; 31 void *markers; 32 t_ptr_size framesize; 33 t_ptr_size offset; 34 } t_sndfileinfo; 35 36 short sndfile_info(char *filename, short vol, t_fourcc type, t_sndfileinfo *info); 37 short soundfile_info(char *filename, short vol, t_fourcc type, t_sndfileinfo *info); 38 long sndfile_writeheader(t_filehandle fh, t_fourcc type, long size, long nchans, long ssize, long srate, t_fourcc samptype); 39 40 #if C74_PRAGMA_STRUCT_PACKPUSH 41 #pragma pack(pop) 42 #elif C74_PRAGMA_STRUCT_PACK 43 #pragma pack() 44 #endif 45 46 enum t_sf_filetype { 47 SF_FILETYPE_AIFF = FOUR_CHAR_CODE('AIFF'), 48 SF_FILETYPE_SD2 = FOUR_CHAR_CODE('Sd2f'), 49 SF_FILETYPE_WAVE = FOUR_CHAR_CODE('WAVE'), 50 SF_FILETYPE_AU = FOUR_CHAR_CODE('ULAW'), 51 SF_FILETYPE_RAW = FOUR_CHAR_CODE('DATA') 52 }; 53 54 enum t_sf_samptype { 55 SF_SAMPTYPE_INT = FOUR_CHAR_CODE('NONE'), 56 SF_SAMPTYPE_UINT = FOUR_CHAR_CODE('UNSN'), 57 SF_SAMPTYPE_FL32 = FOUR_CHAR_CODE('FL32'), 58 SF_SAMPTYPE_FL64 = FOUR_CHAR_CODE('FL64'), 59 SF_SAMPTYPE_MULAW = FOUR_CHAR_CODE('ULAW'), 60 SF_SAMPTYPE_ALAW = FOUR_CHAR_CODE('ALAW'), 61 SF_SAMPTYPE_LE = FOUR_CHAR_CODE('sowt') // little endian twos backwards 62 }; 63 64 #ifdef __cplusplus 65 } 66 #endif 67 68 69 enum { 70 SF_MAXCHANS = 64, 71 SF_MAXVECS = 66, 72 //SF_BUFSIZE = 16384, 73 SF_BUFSIZE_DEF = 120960*4, 74 SF_BUFSIZE_QUANT = 20160, // 8factorial over two...ensures that we won't have problems wrapping 75 SF_MULT = 8, 76 SF_ATOM_MULT = 4, 77 SF_PRELOAD = 1, 78 SF_MAXPEND = 128, 79 SF_EMBED = 1, 80 SF_WEIRDCUE = 18811, 81 SF_MAX_SWITCH_PER_VECTOR = 16 82 }; 83 84 85 typedef struct _sfplay_notification { 86 long cue; 87 } t_sfplay_notification; 88 89 90 typedef struct _soundfile_path { 91 t_symbol *filename; 92 short path; 93 } t_soundfile_path; 94 95 96 #endif // _EXT_SNDFILE_H_