Lines Matching refs:wav
82 unsigned char wav[12]; in sf_open_read() local
84 actual = fread(wav, sizeof(char), sizeof(wav), stream); in sf_open_read()
91 if (memcmp(wav, "RIFF", 4)) { in sf_open_read()
97 unsigned riffSize = little4u(&wav[4]); in sf_open_read()
104 if (memcmp(&wav[8], "WAVE", 4)) { in sf_open_read()
316 unsigned char wav[58]; in sf_open_write() local
317 memset(wav, 0, sizeof(wav)); in sf_open_write()
318 memcpy(wav, "RIFF", 4); in sf_open_write()
319 memcpy(&wav[8], "WAVEfmt ", 8); in sf_open_write()
321 wav[4] = 50; // riffSize in sf_open_write()
322 wav[16] = 18; // fmtSize in sf_open_write()
323 wav[20] = WAVE_FORMAT_IEEE_FLOAT; in sf_open_write()
325 wav[4] = 36; // riffSize in sf_open_write()
326 wav[16] = 16; // fmtSize in sf_open_write()
327 wav[20] = WAVE_FORMAT_PCM; in sf_open_write()
329 wav[22] = info->channels; in sf_open_write()
330 write4u(&wav[24], info->samplerate); in sf_open_write()
354 write4u(&wav[28], byteRate); in sf_open_write()
355 wav[32] = blockAlignment; in sf_open_write()
356 wav[34] = bitsPerSample; in sf_open_write()
359 memcpy(&wav[38], "fact", 4); in sf_open_write()
360 wav[42] = 4; in sf_open_write()
361 memcpy(&wav[50], "data", 4); in sf_open_write()
364 memcpy(&wav[36], "data", 4); in sf_open_write()
366 (void) fwrite(wav, 44 + extra, 1, stream); in sf_open_write()
406 unsigned char wav[58]; in sf_close() local
408 (void) fread(wav, 44 + extra, 1, handle->stream); in sf_close()
410 write4u(&wav[4], dataSize + 36 + extra); // riffSize in sf_close()
411 write4u(&wav[40 + extra], dataSize); // dataSize in sf_close()
413 (void) fwrite(wav, 44 + extra, 1, handle->stream); in sf_close()