# HG changeset patch # User Chris Cannam # Date 1402663540 -3600 # Node ID b38268e34c097c99d19d7430c83d2f6f54b1f44e # Parent 1f2a4ad79967cf85e976332a508d5161e386bd8d The session file records the sample rate that each audio file was saved at. Use it. This is a fix to part of https://code.soundsoftware.ac.uk/issues/970, but it also replaces the commit at https://code.soundsoftware.ac.uk/projects/svapp/repository/revisions/9554c19c42fd with a fix to the earlier bug http://sourceforge.net/p/sv1/bugs/107/. I think this is a better way than the earlier code. diff -r 1f2a4ad79967 -r b38268e34c09 framework/SVFileReader.cpp --- a/framework/SVFileReader.cpp Fri Jun 13 10:37:04 2014 +0100 +++ b/framework/SVFileReader.cpp Fri Jun 13 13:45:40 2014 +0100 @@ -473,12 +473,14 @@ file.waitForData(); - size_t rate = 0; + size_t rate = sampleRate; - if (!mainModel && - Preferences::getInstance()->getResampleOnLoad()) { - WaveFileModel *mm = m_document->getMainModel(); - if (mm) rate = mm->getSampleRate(); + if (rate == 0) { + if (!mainModel && + Preferences::getInstance()->getResampleOnLoad()) { + WaveFileModel *mm = m_document->getMainModel(); + if (mm) rate = mm->getSampleRate(); + } } model = new WaveFileModel(file, rate);