comparison data/fileio/CodedAudioFileReader.cpp @ 921:2896b8872834 tonioni

Add normalise preference and take it into account in WaveFileModel
author Chris Cannam
date Fri, 13 Jun 2014 16:12:00 +0100
parents f3cda3280398
children 9911b8cb53bc
comparison
equal deleted inserted replaced
920:f3cda3280398 921:2896b8872834
44 m_fileFrameCount(0), 44 m_fileFrameCount(0),
45 m_normalised(normalised), 45 m_normalised(normalised),
46 m_max(0.f), 46 m_max(0.f),
47 m_gain(1.f) 47 m_gain(1.f)
48 { 48 {
49 SVDEBUG << "CodedAudioFileReader::CodedAudioFileReader: rate " << targetRate << ", normalised = " << normalised << endl; 49 cerr << "CodedAudioFileReader::CodedAudioFileReader: rate " << targetRate << ", normalised = " << normalised << endl;
50 50
51 m_frameCount = 0; 51 m_frameCount = 0;
52 m_sampleRate = targetRate; 52 m_sampleRate = targetRate;
53 } 53 }
54 54
444 m_dataLock.unlock(); 444 m_dataLock.unlock();
445 } 445 }
446 } 446 }
447 447
448 if (m_normalised) { 448 if (m_normalised) {
449 cerr << "CodedAudioFileReader::getInterleavedFrames: normalised, gain = " << m_gain << endl;
449 for (int i = 0; i < (int)(count * m_channelCount); ++i) { 450 for (int i = 0; i < (int)(count * m_channelCount); ++i) {
450 frames[i] *= m_gain; 451 frames[i] *= m_gain;
451 } 452 }
452 } 453 }
453 } 454 }