length(0),
bitrate(0),
sampleRate(0),
- channels(0)
+ channels(0),
+ sampleWidth(0)
{
}
int bitrate;
int sampleRate;
int channels;
+ int sampleWidth;
};
////////////////////////////////////////////////////////////////////////////////
return d->channels;
}
+int RIFF::AIFF::Properties::sampleWidth() const
+{
+ return d->sampleWidth;
+}
+
////////////////////////////////////////////////////////////////////////////////
// private members
////////////////////////////////////////////////////////////////////////////////
{
d->channels = data.mid(0, 2).toShort();
uint sampleFrames = data.mid(2, 4).toUInt();
- short sampleSize = data.mid(6, 2).toShort();
+ d->sampleWidth = data.mid(6, 2).toShort();
double sampleRate = ConvertFromIeeeExtended(reinterpret_cast<unsigned char *>(data.mid(8, 10).data()));
d->sampleRate = sampleRate;
- d->bitrate = (sampleRate * sampleSize * d->channels) / 1024.0;
+ d->bitrate = (sampleRate * d->sampleWidth * d->channels) / 1024.0;
d->length = sampleFrames / d->sampleRate;
}
virtual int sampleRate() const;
virtual int channels() const;
+ int sampleWidth() const;
+
private:
Properties(const Properties &);
Properties &operator=(const Properties &);
bitrate(0),
sampleRate(0),
channels(0),
- streamLength(streamLength)
+ sampleWidth(0),
+ streamLength(streamLength)
{
}
int bitrate;
int sampleRate;
int channels;
+ int sampleWidth;
uint streamLength;
};
return d->channels;
}
+int RIFF::WAV::Properties::sampleWidth() const
+{
+ return d->sampleWidth;
+}
+
////////////////////////////////////////////////////////////////////////////////
// private members
////////////////////////////////////////////////////////////////////////////////
d->format = data.mid(0, 2).toShort(false);
d->channels = data.mid(2, 2).toShort(false);
d->sampleRate = data.mid(4, 4).toUInt(false);
+ d->sampleWidth = data.mid(14, 2).toShort(false);
uint byteRate = data.mid(8, 4).toUInt(false);
d->bitrate = byteRate * 8 / 1024;
virtual int sampleRate() const;
virtual int channels() const;
+ int sampleWidth() const;
+
private:
Properties(const Properties &);
Properties &operator=(const Properties &);