Lines Matching refs:header
124 if (FDKfread(&(wav->header.riffType), 1, 4, wav->fp) != 4) { in WAV_InputOpen()
128 if (FDKstrncmp("RIFF", wav->header.riffType, 4)) { in WAV_InputOpen()
134 FDKfread_EL(&(wav->header.riffSize), 4, 1, wav->fp); in WAV_InputOpen()
137 if (FDKfread(&wav->header.waveType, 1, 4, wav->fp) !=4) { in WAV_InputOpen()
141 if (FDKstrncmp("WAVE", wav->header.waveType, 4)) { in WAV_InputOpen()
147 if (FDKfread(&(wav->header.formatType), 1, 4, wav->fp) != 4) { in WAV_InputOpen()
151 if (FDKstrncmp("fmt", wav->header.formatType, 3)) { in WAV_InputOpen()
157 …FDKfread_EL(&wav->header.formatSize, 4, 1, wav->fp); /* should be 16 for PCM-format (uncompresse… in WAV_InputOpen()
161 FDKfread_EL(&(wav->header.compressionCode), 2, 1, wav->fp); in WAV_InputOpen()
162 FDKfread_EL(&(wav->header.numChannels), 2, 1, wav->fp); in WAV_InputOpen()
163 FDKfread_EL(&(wav->header.sampleRate), 4, 1, wav->fp); in WAV_InputOpen()
164 FDKfread_EL(&(wav->header.bytesPerSecond), 4, 1, wav->fp); in WAV_InputOpen()
165 FDKfread_EL(&(wav->header.blockAlign), 2, 1, wav->fp); in WAV_InputOpen()
166 FDKfread_EL(&(wav->header.bitsPerSample), 2, 1, wav->fp); in WAV_InputOpen()
168 offset = wav->header.formatSize - 16; in WAV_InputOpen()
171 if (wav->header.compressionCode == 0xFFFE) { in WAV_InputOpen()
191 if (i == 16) wav->header.compressionCode = 0x01; in WAV_InputOpen()
199 FDKfread(&wav->header.formatSize, 1, 1, wav->fp); in WAV_InputOpen()
204 if (FDKfread(wav->header.dataType, 1, 4, wav->fp) != 4) { in WAV_InputOpen()
214 if (FDKstrncmp("data", wav->header.dataType, 4) == 0) { in WAV_InputOpen()
215 wav->header.dataSize = offset; in WAV_InputOpen()
220 FDKfread(&(wav->header.dataSize), 1, 1, wav->fp); in WAV_InputOpen()
267 switch (wav->header.compressionCode) in WAV_InputRead()
270 if (nBits == wav->header.bitsPerSample) { in WAV_InputRead()
271 result = FDKfread_EL(buffer, wav->header.bitsPerSample >> 3, numSamples, wav->fp) ; in WAV_InputRead()
277 result += FDKfread_EL(&tmp, wav->header.bitsPerSample >> 3, 1, wav->fp) ; in WAV_InputRead()
280 … if ( !IS_LITTLE_ENDIAN() && wav->header.bitsPerSample != 24 && wav->header.bitsPerSample < 32) { in WAV_InputRead()
281 tmp >>= (32-wav->header.bitsPerSample); in WAV_InputRead()
285 if (wav->header.bitsPerSample > nBits) in WAV_InputRead()
286 tmp >>= (wav->header.bitsPerSample-nBits); in WAV_InputRead()
288 tmp <<= (nBits-wav->header.bitsPerSample); in WAV_InputRead()
408 FDKstrcpy(wav->header.riffType, "RIFF"); in WAV_OutputOpen()
409 …wav->header.riffSize = LittleEndian32(0x7fffffff); /* in case fseek() doesn't work later in WAV_O… in WAV_OutputOpen()
410 FDKstrcpy(wav->header.waveType, "WAVE"); in WAV_OutputOpen()
412 FDKstrcpy(wav->header.formatType, "fmt "); in WAV_OutputOpen()
413 wav->header.formatSize = LittleEndian32(16); in WAV_OutputOpen()
415 wav->header.compressionCode = LittleEndian16(0x01); in WAV_OutputOpen()
416 wav->header.bitsPerSample = LittleEndian16((SHORT)bitsPerSample); in WAV_OutputOpen()
417 wav->header.numChannels = LittleEndian16((SHORT)numChannels); in WAV_OutputOpen()
418 wav->header.blockAlign = LittleEndian16((SHORT)(numChannels * (bitsPerSample >> 3))); in WAV_OutputOpen()
419 wav->header.sampleRate = LittleEndian32(sampleRate); in WAV_OutputOpen()
420 wav->header.bytesPerSecond = LittleEndian32(sampleRate * wav->header.blockAlign); in WAV_OutputOpen()
421 FDKstrcpy(wav->header.dataType, "data"); in WAV_OutputOpen()
422 wav->header.dataSize = LittleEndian32(0x7fffffff - 36); in WAV_OutputOpen()
426 if (FDKfwrite(&wav->header, 1, size, wav->fp) != size) in WAV_OutputOpen()
433 wav->header.dataSize = wav->header.riffSize = 0; in WAV_OutputOpen()
472 int bps = Unpack(wav->header.bitsPerSample); in WAV_OutputWrite()
516 wav->header.dataSize += (numberOfSamples * (bps>>3)); in WAV_OutputWrite()
535 wav->header.dataSize = LittleEndian32(wav->header.dataSize); in WAV_OutputClose()
536 wav->header.riffSize = LittleEndian32(wav->header.dataSize + 36); in WAV_OutputClose()
545 if (FDKfwrite(&wav->header.riffType, 1, size, wav->fp) != size) in WAV_OutputClose()