• Home
  • Raw
  • Download

Lines Matching refs:wFile

134     WAVE_FILE *wFile;  in WaveFileCreate()  local
137 wFile = malloc(sizeof(WAVE_FILE)); in WaveFileCreate()
138 if (!wFile) in WaveFileCreate()
140 wFile->write = EAS_TRUE; in WaveFileCreate()
143 wFile->file = fopen(filename,"wb"); in WaveFileCreate()
144 if (!wFile->file) in WaveFileCreate()
146 free(wFile); in WaveFileCreate()
151 wFile->wh.nRiffTag = riffTag; in WaveFileCreate()
152 wFile->wh.nRiffSize = sizeof(WAVE_HEADER) - 8; in WaveFileCreate()
153 wFile->wh.nWaveTag = waveTag; in WaveFileCreate()
154 wFile->wh.nFmtTag = fmtTag; in WaveFileCreate()
155 wFile->wh.nFmtSize = sizeof(FMT_CHUNK); in WaveFileCreate()
158 wFile->wh.fc.wFormatTag = 1; in WaveFileCreate()
159 wFile->wh.fc.nChannels = (EAS_U16) nChannels; in WaveFileCreate()
160 wFile->wh.fc.nSamplesPerSec = (EAS_U32) nSamplesPerSec; in WaveFileCreate()
161 wFile->wh.fc.wBitsPerSample = (EAS_U16) wBitsPerSample; in WaveFileCreate()
162 wFile->wh.fc.nBlockAlign = (EAS_U16) (nChannels * (EAS_U16) (wBitsPerSample / 8)); in WaveFileCreate()
163 wFile->wh.fc.nAvgBytesPerSec = wFile->wh.fc.nBlockAlign * (EAS_U32) nSamplesPerSec; in WaveFileCreate()
166 wFile->wh.nDataTag = dataTag; in WaveFileCreate()
167 wFile->wh.nDataSize = 0; in WaveFileCreate()
170 FlipWaveHeader(&wFile->wh); in WaveFileCreate()
174 if (fwrite(&wFile->wh, sizeof(WAVE_HEADER), 1, wFile->file) != 1) in WaveFileCreate()
176 fclose(wFile->file); in WaveFileCreate()
177 free(wFile); in WaveFileCreate()
182 FlipWaveHeader(&wFile->wh); in WaveFileCreate()
186 return wFile; in WaveFileCreate()
200 EAS_I32 WaveFileWrite (WAVE_FILE *wFile, void *buffer, EAS_I32 n) in WaveFileWrite() argument
205 if (wFile == NULL) in WaveFileWrite()
222 count = (EAS_I32) fwrite(buffer, 1, (size_t) n, wFile->file); in WaveFileWrite()
225 wFile->wh.nRiffSize += (EAS_U32) count; in WaveFileWrite()
226 wFile->wh.nDataSize += (EAS_U32) count; in WaveFileWrite()
244 EAS_BOOL WaveFileClose (WAVE_FILE *wFile) in WaveFileClose() argument
249 if (wFile->write) in WaveFileClose()
251 if (fseek(wFile->file, 0L, SEEK_SET) == 0) in WaveFileClose()
255 FlipWaveHeader(&wFile->wh); in WaveFileClose()
257 count = (EAS_I32) fwrite(&wFile->wh, sizeof(WAVE_HEADER), 1, wFile->file); in WaveFileClose()
259 FlipWaveHeader(&wFile->wh); in WaveFileClose()
265 if (fclose(wFile->file) != 0) in WaveFileClose()
269 free(wFile); in WaveFileClose()
293 WAVE_FILE *wFile; in WaveFileOpen() local
305 wFile = malloc(sizeof(WAVE_FILE)); in WaveFileOpen()
306 if (!wFile) in WaveFileOpen()
310 wFile->write = EAS_FALSE; in WaveFileOpen()
311 wFile->file = fopen(filename,"rb"); in WaveFileOpen()
312 if (!wFile->file) in WaveFileOpen()
314 free(wFile); in WaveFileOpen()
332 if (fread(&chunk, sizeof(chunk), 1, wFile->file) != 1) in WaveFileOpen()
345 if (fread(&tag, sizeof(tag), 1, wFile->file) != 1) in WaveFileOpen()
358 if (fread(&chunk, sizeof(chunk), 1, wFile->file) != 1) in WaveFileOpen()
362 startChunkPos = ftell(wFile->file); in WaveFileOpen()
366 fseek(wFile->file, startChunkPos + (EAS_I32) chunk.size, SEEK_SET); in WaveFileOpen()
374 if (fread(&wFile->wh.fc, sizeof(FMT_CHUNK), 1, wFile->file) != 1) in WaveFileOpen()
378 fseek(wFile->file, startChunkPos + (EAS_I32) chunk.size, SEEK_SET); in WaveFileOpen()
385 if (fread(&chunk, sizeof(chunk), 1, wFile->file) != 1) in WaveFileOpen()
389 startChunkPos = ftell(wFile->file); in WaveFileOpen()
393 fseek(wFile->file, startChunkPos + (EAS_I32) chunk.size, SEEK_SET); in WaveFileOpen()
396 wFile->dataSize = chunk.size; in WaveFileOpen()
412 fclose(wFile->file); in WaveFileOpen()
413 free(wFile); in WaveFileOpen()
418 return wFile; in WaveFileOpen()