Mercurial > hg > sonic-visualiser
comparison audioio/AudioCallbackPlaySource.cpp @ 14:085f34c73939
* IntegerTimeStretcher -> PhaseVocoderTimeStretcher (no longer confined to
integer multiples)
author | Chris Cannam |
---|---|
date | Wed, 13 Sep 2006 11:06:28 +0000 |
parents | 00ed645f4175 |
children | cc566264c935 |
comparison
equal
deleted
inserted
replaced
13:00ed645f4175 | 14:085f34c73939 |
---|---|
20 #include "data/model/Model.h" | 20 #include "data/model/Model.h" |
21 #include "view/ViewManager.h" | 21 #include "view/ViewManager.h" |
22 #include "base/PlayParameterRepository.h" | 22 #include "base/PlayParameterRepository.h" |
23 #include "data/model/DenseTimeValueModel.h" | 23 #include "data/model/DenseTimeValueModel.h" |
24 #include "data/model/SparseOneDimensionalModel.h" | 24 #include "data/model/SparseOneDimensionalModel.h" |
25 #include "IntegerTimeStretcher.h" | 25 #include "PhaseVocoderTimeStretcher.h" |
26 | 26 |
27 #include <iostream> | 27 #include <iostream> |
28 #include <cassert> | 28 #include <cassert> |
29 | 29 |
30 //#define DEBUG_AUDIO_PLAY_SOURCE 1 | 30 //#define DEBUG_AUDIO_PLAY_SOURCE 1 |
31 #define DEBUG_AUDIO_PLAY_SOURCE_PLAYING 1 | 31 //#define DEBUG_AUDIO_PLAY_SOURCE_PLAYING 1 |
32 | 32 |
33 //const size_t AudioCallbackPlaySource::m_ringBufferSize = 102400; | 33 //const size_t AudioCallbackPlaySource::m_ringBufferSize = 102400; |
34 const size_t AudioCallbackPlaySource::m_ringBufferSize = 131071; | 34 const size_t AudioCallbackPlaySource::m_ringBufferSize = 131071; |
35 | 35 |
36 AudioCallbackPlaySource::AudioCallbackPlaySource(ViewManager *manager) : | 36 AudioCallbackPlaySource::AudioCallbackPlaySource(ViewManager *manager) : |
598 | 598 |
599 for (size_t ch = 0; ch < channels; ++ch) { | 599 for (size_t ch = 0; ch < channels; ++ch) { |
600 | 600 |
601 m_stretcher[ch] = StretcherBuffer | 601 m_stretcher[ch] = StretcherBuffer |
602 //!!! | 602 //!!! |
603 (new IntegerTimeStretcher(factor, | 603 (new PhaseVocoderTimeStretcher(factor, |
604 blockSize, | 604 blockSize, |
605 // 128), | 605 // 128), |
606 (blockSize/2) / factor), | 606 (blockSize/2) / factor), |
607 new float[lrintf(blockSize * factor)]); | 607 new float[lrintf(blockSize * factor)]); |
608 } | 608 } |
619 m_stretcher.erase(m_stretcher.begin()); | 619 m_stretcher.erase(m_stretcher.begin()); |
620 } | 620 } |
621 delete m_stretchInputBuffer; | 621 delete m_stretchInputBuffer; |
622 } | 622 } |
623 | 623 |
624 IntegerTimeStretcher * | 624 PhaseVocoderTimeStretcher * |
625 AudioCallbackPlaySource::TimeStretcherData::getStretcher(size_t channel) | 625 AudioCallbackPlaySource::TimeStretcherData::getStretcher(size_t channel) |
626 { | 626 { |
627 return m_stretcher[channel].first; | 627 return m_stretcher[channel].first; |
628 } | 628 } |
629 | 629 |