Logo Search packages:      
Sourcecode: f-spot version File versions  Download package

TagLib::Riff::WaveFormatEx::WaveFormatEx ( ByteVector  data,
int  offset 
) [inline]

Constructs and initializes a new instance of WaveFormatEx by reading the raw structure from a specified position in a ByteVector object.

dataA ByteVector object containing the raw data structure.
offsetA int value specifying the index in data at which the structure begins.
ArgumentNullExceptiondata is .
ArgumentOutOfRangeExceptionoffset is less than zero.
CorruptFileExceptiondata contains less than 16 bytes at offset .

Definition at line 110 of file WaveFormatEx.cs.

References TagLib::ByteVector::Count, TagLib::ByteVector::Mid(), TagLib::ByteVector::ToUInt(), and TagLib::ByteVector::ToUShort().

                  if (data == null)
                        throw new ArgumentNullException ("data");
                  if (offset < 0)
                        throw new ArgumentOutOfRangeException (
                  if (offset + 16 > data.Count)
                        throw new CorruptFileException (
                              "Expected 16 bytes.");
                  format_tag = data.Mid (offset, 2).ToUShort (false);
                  channels = data.Mid (offset + 2, 2).ToUShort (false);
                  samples_per_second = data.Mid (offset + 4, 4)
                        .ToUInt (false);
                  average_bytes_per_second = data.Mid (offset + 8, 4)
                        .ToUInt (false);
                  bits_per_sample = data.Mid (offset + 14, 2)
                        .ToUShort (false);

Here is the call graph for this function:

Generated by  Doxygen 1.6.0   Back to index