pvfileio.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027 #ifndef __PVFILEIO_H_INCLUDED
00028 #define __PVFILEIO_H_INCLUDED
00029
00030 #include "sysdep.h"
00031
00032 #if defined(WIN32) || defined(_WIN32) || defined(_MSC_VER)
00033
00034 #include <windows.h>
00035
00036 #else
00037
00038 typedef struct _GUID
00039 {
00040 uint32_t Data1;
00041 uint16_t Data2;
00042 uint16_t Data3;
00043 unsigned char Data4[8];
00044 } GUID;
00045
00046 typedef struct {
00047 uint16_t wFormatTag;
00048 uint16_t nChannels;
00049 uint32_t nSamplesPerSec;
00050 uint32_t nAvgBytesPerSec;
00051 uint16_t nBlockAlign;
00052 uint16_t wBitsPerSample;
00053 uint16_t cbSize;
00054 } WAVEFORMATEX;
00055
00056 #endif
00057
00058
00059
00060 typedef enum pvoc_wordformat {
00061 PVOC_IEEE_FLOAT,
00062 PVOC_IEEE_DOUBLE
00063 } pvoc_wordformat;
00064
00065
00066
00067 typedef enum pvoc_frametype {
00068 PVOC_AMP_FREQ = 0,
00069 PVOC_AMP_PHASE,
00070 PVOC_COMPLEX
00071 } pvoc_frametype;
00072
00073
00074
00075 typedef enum pvoc_windowtype {
00076 PVOC_DEFAULT = 0,
00077 PVOC_HAMMING,
00078 PVOC_HANN,
00079 PVOC_KAISER,
00080 PVOC_RECT,
00081 PVOC_CUSTOM
00082 } pv_wtype;
00083
00084
00085
00086 typedef enum pvoc_sampletype {
00087 STYPE_16,
00088 STYPE_24,
00089 STYPE_32,
00090 STYPE_IEEE_FLOAT
00091 } pv_stype;
00092
00093 typedef struct pvoc_data {
00094 uint16_t wWordFormat;
00095 uint16_t wAnalFormat;
00096 uint16_t wSourceFormat;
00097 uint16_t wWindowType;
00098 uint32_t nAnalysisBins;
00099 uint32_t dwWinlen;
00100
00101 uint32_t dwOverlap;
00102 uint32_t dwFrameAlign;
00103 float fAnalysisRate;
00104 float fWindowParam;
00105 } PVOCDATA;
00106
00107 typedef struct {
00108 WAVEFORMATEX Format;
00109
00110 union {
00111 uint16_t wValidBitsPerSample;
00112
00113 uint16_t wSamplesPerBlock;
00114 uint16_t wReserved;
00115 } Samples;
00116 uint32_t dwChannelMask;
00117
00118 GUID SubFormat;
00119 } WAVEFORMATEXTENSIBLE, *PWAVEFORMATEXTENSIBLE;
00120
00121 typedef struct {
00122 WAVEFORMATEXTENSIBLE wxFormat;
00123 uint32_t dwVersion;
00124 uint32_t dwDataSize;
00125 PVOCDATA data;
00126 } WAVEFORMATPVOCEX;
00127
00128
00129
00130 #define SIZEOF_FMTPVOCEX (80)
00131
00132 #define SIZEOF_WFMTEX (18)
00133 #define PVX_VERSION (1)
00134
00135
00136
00137
00138
00139
00140
00141 #ifndef CSOUND_CSDL_H
00142
00143 extern const GUID KSDATAFORMAT_SUBTYPE_PVOC;
00144
00145
00146
00147 const char *pvoc_errorstr(CSOUND *);
00148 int init_pvsys(CSOUND *);
00149 int pvoc_createfile(CSOUND *, const char *,
00150 unsigned long, unsigned long, unsigned long,
00151 unsigned long, long, int, int,
00152 float, float *, unsigned long);
00153 int pvoc_openfile(CSOUND *,
00154 const char *filename, PVOCDATA *data, WAVEFORMATEX *fmt);
00155 int pvoc_closefile(CSOUND *, int);
00156 int pvoc_putframes(CSOUND *,
00157 int ofd, const float *frame, long numframes);
00158 int pvoc_getframes(CSOUND *,
00159 int ifd, float *frames, unsigned long nframes);
00160 int pvoc_framecount(CSOUND *, int ifd);
00161 int pvoc_fseek(CSOUND *, int ifd, int offset);
00162 int pvsys_release(CSOUND *);
00163
00164 #endif
00165
00166 #endif
00167