Update code to current Chromium master
This corresponds to: Chromium: 6555f9456074c0c0e5f7713564b978588ac04a5d webrtc: c8b569e0a7ad0b369e15f0197b3a558699ec8efa
This commit is contained in:
@ -37,9 +37,17 @@ class ReadableWavFile : public ReadableWav {
|
||||
FILE* file_;
|
||||
};
|
||||
|
||||
std::string WavFile::FormatAsString() const {
|
||||
std::ostringstream s;
|
||||
s << "Sample rate: " << sample_rate() << " Hz, Channels: " << num_channels()
|
||||
<< ", Duration: "
|
||||
<< (1.f * num_samples()) / (num_channels() * sample_rate()) << " s";
|
||||
return s.str();
|
||||
}
|
||||
|
||||
WavReader::WavReader(const std::string& filename)
|
||||
: file_handle_(fopen(filename.c_str(), "rb")) {
|
||||
RTC_CHECK(file_handle_ && "Could not open wav file for reading.");
|
||||
RTC_CHECK(file_handle_) << "Could not open wav file for reading.";
|
||||
|
||||
ReadableWavFile readable(file_handle_);
|
||||
WavFormat format;
|
||||
@ -96,7 +104,7 @@ WavWriter::WavWriter(const std::string& filename, int sample_rate,
|
||||
num_channels_(num_channels),
|
||||
num_samples_(0),
|
||||
file_handle_(fopen(filename.c_str(), "wb")) {
|
||||
RTC_CHECK(file_handle_ && "Could not open wav file for writing.");
|
||||
RTC_CHECK(file_handle_) << "Could not open wav file for writing.";
|
||||
RTC_CHECK(CheckWavParameters(num_channels_, sample_rate_, kWavFormat,
|
||||
kBytesPerSample, num_samples_));
|
||||
|
||||
|
Reference in New Issue
Block a user