Logo Search packages:      
Sourcecode: catcodec version File versions  Download package

void Sample::WriteSample ( FileWriter writer ) const

Write a sample to a writer. If only a sample is written to the file it would be a valid WAV file.

Parameters:
writerplace to write the sample to

Definition at line 183 of file sample.cpp.

References bits_per_sample, num_channels, RIFF_HEADER_SIZE, sample_data, sample_rate, sample_size, size, FileWriter::WriteDword(), FileWriter::WriteRaw(), and FileWriter::WriteWord().

Referenced by WriteCatEntry(), and WriteSFO().

{
      assert(this->sample_data != NULL);

      writer.WriteDword('FFIR');
      writer.WriteDword(this->size - 8);
      writer.WriteDword('EVAW');

      writer.WriteDword(' tmf');
      writer.WriteDword(16);
      writer.WriteWord(1);
      writer.WriteWord(this->num_channels);
      writer.WriteDword(this->sample_rate);
      writer.WriteDword(this->sample_rate * this->num_channels * this->bits_per_sample / 8);
      writer.WriteWord(this->num_channels * this->bits_per_sample / 8);
      writer.WriteWord(this->bits_per_sample);

      writer.WriteDword('atad');
      writer.WriteDword(this->sample_size);
      writer.WriteRaw(this->sample_data, this->size - RIFF_HEADER_SIZE);
}

Here is the call graph for this function:

Here is the caller graph for this function:


Generated by  Doxygen 1.6.0   Back to index