copyFrom has a template parameter ‘OtherSampleType’, should it be possible to copy from a double buffer to a float buffer (or vice versa) ?
This doesn’t compile:
juce::AudioBuffer<double> sourceData(1, 1000);
juce::dsp::AudioBlock<double> source(sourceData);
juce::AudioBuffer<float> destData(1, 1000);
juce::dsp::AudioBlock<float> dest(destData);
dest.copyFrom<double>(source);
Output:
1>Main.cpp
1>C:\Users\user\dev\juce\modules\juce_dsp\containers\juce_AudioBlock.h(624,1): error C2665: 'juce::detail::FloatVectorOperationsBase<float,int>::copy': none of the 4 overloads could convert all the argument types
1>C:\Users\user\dev\juce\modules\juce_audio_basics\buffers\juce_FloatVectorOperations.h(44,31): message : could be 'void juce::detail::FloatVectorOperationsBase<float,size_t>::copy(FloatType *,const FloatType *,CountType) noexcept'
1> with
1> [
1> FloatType=float,
1> CountType=size_t
1> ]
1>C:\Users\user\dev\juce\modules\juce_audio_basics\buffers\juce_FloatVectorOperations.h(44,31): message : or 'void juce::detail::FloatVectorOperationsBase<double,size_t>::copy(FloatType *,const FloatType *,CountType) noexcept'
1> with
1> [
1> FloatType=double,
1> CountType=size_t
1> ]
1>C:\Users\user\dev\juce\modules\juce_audio_basics\buffers\juce_FloatVectorOperations.h(44,31): message : or 'void juce::detail::FloatVectorOperationsBase<double,int>::copy(FloatType *,const FloatType *,CountType) noexcept'
1> with
1> [
1> FloatType=double,
1> CountType=int
1> ]
1>C:\Users\user\dev\juce\modules\juce_audio_basics\buffers\juce_FloatVectorOperations.h(44,31): message : or 'void juce::detail::FloatVectorOperationsBase<float,int>::copy(FloatType *,const FloatType *,CountType) noexcept'
1> with
1> [
1> FloatType=float,
1> CountType=int
1> ]
1>C:\Users\user\dev\juce\modules\juce_dsp\containers\juce_AudioBlock.h(624,1): message : while trying to match the argument list '(float *, double *, Type)'
1> with
1> [
1> Type=size_t
1> ]
1>C:\Users\user\dev\juce\modules\juce_dsp\containers\juce_AudioBlock.h(314): message : see reference to function template instantiation 'void juce::dsp::AudioBlock<float>::copyFromInternal<double>(const juce::dsp::AudioBlock<double> &) noexcept const' being compiled
1>C:\Users\user\dev\juce\modules\juce_dsp\containers\juce_AudioBlock.h(314): message : see reference to function template instantiation 'void juce::dsp::AudioBlock<float>::copyFromInternal<double>(const juce::dsp::AudioBlock<double> &) noexcept const' being compiled
1>C:\Users\user\dev\test\testAudioBlock\NewProject\Source\Main.cpp(22): message : see reference to function template instantiation 'juce::dsp::AudioBlock<float> &juce::dsp::AudioBlock<float>::copyFrom<double>(const juce::dsp::AudioBlock<double> &) noexcept' being compiled
1>C:\Users\user\dev\test\testAudioBlock\NewProject\Source\Main.cpp(22): message : see reference to function template instantiation 'juce::dsp::AudioBlock<float> &juce::dsp::AudioBlock<float>::copyFrom<double>(const juce::dsp::AudioBlock<double> &) noexcept' being compiled
