Lines Matching refs:file

7  * This module contains .WAV file functions for the EAS synthesizer
13 * you may not use this file except in compliance with the License.
40 /* .WAV file format tags */
123 * Purpose: Opens a wave file for writing and writes the header
142 /* create the file */
143 wFile->file = fopen(filename,"wb");
144 if (!wFile->file)
150 /* initialize PCM format .WAV file header */
174 if (fwrite(&wFile->wh, sizeof(WAVE_HEADER), 1, wFile->file) != 1)
176 fclose(wFile->file);
185 /* return the file handle */
192 * Purpose: Writes data to the wave file
204 /* make sure we have an open file */
222 count = (EAS_I32) fwrite(buffer, 1, (size_t) n, wFile->file);
235 * Purpose: Opens a wave file for writing and writes the header
248 /* return to beginning of file and write the header */
251 if (fseek(wFile->file, 0L, SEEK_SET) == 0)
257 count = (EAS_I32) fwrite(&wFile->wh, sizeof(WAVE_HEADER), 1, wFile->file);
264 /* close the file */
265 if (fclose(wFile->file) != 0)
271 /* return the file handle */
282 * Purpose: Opens a wave file for reading and reads the header
309 /* open the file */
311 wFile->file = fopen(filename,"rb");
312 if (!wFile->file)
322 /* read the RIFF tag and file size */
332 if (fread(&chunk, sizeof(chunk), 1, wFile->file) != 1)
345 if (fread(&tag, sizeof(tag), 1, wFile->file) != 1)
358 if (fread(&chunk, sizeof(chunk), 1, wFile->file) != 1)
362 startChunkPos = ftell(wFile->file);
366 fseek(wFile->file, startChunkPos + (EAS_I32) chunk.size, SEEK_SET);
374 if (fread(&wFile->wh.fc, sizeof(FMT_CHUNK), 1, wFile->file) != 1)
378 fseek(wFile->file, startChunkPos + (EAS_I32) chunk.size, SEEK_SET);
385 if (fread(&chunk, sizeof(chunk), 1, wFile->file) != 1)
389 startChunkPos = ftell(wFile->file);
393 fseek(wFile->file, startChunkPos + (EAS_I32) chunk.size, SEEK_SET);
412 fclose(wFile->file);
417 /* return the file handle */