comparison audioio/AudioCallbackPlaySource.cpp @ 39:4ed2448582cc

* Switch from fftw3 to fftw3f. I think the efficiency improvement is probably worth the lower precision, although I ought to do a few more tests.
author Chris Cannam
date Thu, 15 Jun 2006 12:28:47 +0000
parents 54287e5e7451
children a4a05344c7d6
comparison
equal deleted inserted replaced
38:54287e5e7451 39:4ed2448582cc
600 m_stretcher[ch] = StretcherBuffer 600 m_stretcher[ch] = StretcherBuffer
601 //!!! We really need to measure performance and work out 601 //!!! We really need to measure performance and work out
602 //what sort of quality level to use -- or at least to 602 //what sort of quality level to use -- or at least to
603 //allow the user to configure it 603 //allow the user to configure it
604 (new IntegerTimeStretcher(factor, blockSize, 128), 604 (new IntegerTimeStretcher(factor, blockSize, 128),
605 new double[blockSize * factor]); 605 new float[blockSize * factor]);
606 } 606 }
607 m_stretchInputBuffer = new double[blockSize]; 607 m_stretchInputBuffer = new float[blockSize];
608 } 608 }
609 609
610 AudioCallbackPlaySource::TimeStretcherData::~TimeStretcherData() 610 AudioCallbackPlaySource::TimeStretcherData::~TimeStretcherData()
611 { 611 {
612 // std::cerr << "TimeStretcherData::~TimeStretcherData" << std::endl; 612 // std::cerr << "TimeStretcherData::~TimeStretcherData" << std::endl;
623 AudioCallbackPlaySource::TimeStretcherData::getStretcher(size_t channel) 623 AudioCallbackPlaySource::TimeStretcherData::getStretcher(size_t channel)
624 { 624 {
625 return m_stretcher[channel].first; 625 return m_stretcher[channel].first;
626 } 626 }
627 627
628 double * 628 float *
629 AudioCallbackPlaySource::TimeStretcherData::getOutputBuffer(size_t channel) 629 AudioCallbackPlaySource::TimeStretcherData::getOutputBuffer(size_t channel)
630 { 630 {
631 return m_stretcher[channel].second; 631 return m_stretcher[channel].second;
632 } 632 }
633 633
634 double * 634 float *
635 AudioCallbackPlaySource::TimeStretcherData::getInputBuffer() 635 AudioCallbackPlaySource::TimeStretcherData::getInputBuffer()
636 { 636 {
637 return m_stretchInputBuffer; 637 return m_stretchInputBuffer;
638 } 638 }
639 639
719 } 719 }
720 720
721 if (m_slowdownCounter == 0) { 721 if (m_slowdownCounter == 0) {
722 722
723 size_t got = 0; 723 size_t got = 0;
724 double *ib = timeStretcher->getInputBuffer(); 724 float *ib = timeStretcher->getInputBuffer();
725 725
726 for (size_t ch = 0; ch < getTargetChannelCount(); ++ch) { 726 for (size_t ch = 0; ch < getTargetChannelCount(); ++ch) {
727 727
728 RingBuffer<float> *rb = getReadRingBuffer(ch); 728 RingBuffer<float> *rb = getReadRingBuffer(ch);
729 729
751 m_slowdownCounter = 0; 751 m_slowdownCounter = 0;
752 } 752 }
753 753
754 for (size_t ch = 0; ch < getTargetChannelCount(); ++ch) { 754 for (size_t ch = 0; ch < getTargetChannelCount(); ++ch) {
755 755
756 double *ob = timeStretcher->getOutputBuffer(ch); 756 float *ob = timeStretcher->getOutputBuffer(ch);
757 757
758 #ifdef DEBUG_AUDIO_PLAY_SOURCE 758 #ifdef DEBUG_AUDIO_PLAY_SOURCE
759 std::cerr << "AudioCallbackPlaySource::getSamples: Copying from (" << (m_slowdownCounter * count) << "," << count << ") to buffer" << std::endl; 759 std::cerr << "AudioCallbackPlaySource::getSamples: Copying from (" << (m_slowdownCounter * count) << "," << count << ") to buffer" << std::endl;
760 #endif 760 #endif
761 761