C++ 播放音频处理器的最简单的独立JUCE应用程序?
我找到的所有JUCE教程和音频处理器示例都是插件。如果我想创建自己的应用程序,不带插件,播放C++ 播放音频处理器的最简单的独立JUCE应用程序?,c++,audio,signal-processing,juce,C++,Audio,Signal Processing,Juce,我找到的所有JUCE教程和音频处理器示例都是插件。如果我想创建自己的应用程序,不带插件,播放音频处理器,该怎么办 例如: HelloSamplerAudioProcessor::HelloSamplerAudioProcessor() : AudioProcessor (BusesProperties() .withOutput("Output", juce::AudioChannelSet::stereo(), true) 我正在将
音频处理器
,该怎么办
例如:
HelloSamplerAudioProcessor::HelloSamplerAudioProcessor()
: AudioProcessor (BusesProperties()
.withOutput("Output", juce::AudioChannelSet::stereo(), true)
我正在将其插入一个音频设备管理器
,如下所示:
auto samplerProcessor = std::make_shared<HelloSamplerAudioProcessor>();
auto samplerProcessorPlayer = std::make_shared<juce::AudioProcessorPlayer>();
samplerProcessorPlayer->setProcessor (samplerProcessor.get());
deviceManager.addAudioCallback (samplerProcessorPlayer.get());
这些是从这里来的:
void AudioProcessor::setPlayConfigDetails (int newNumIns, int newNumOuts, double newSampleRate, int newBlockSize)
{
bool success = true;
if (getTotalNumInputChannels() != newNumIns)
success &= setChannelLayoutOfBus (true, 0, AudioChannelSet::canonicalChannelSet (newNumIns));
// failed to find a compatible input configuration
jassert (success); //line 350
if (getTotalNumOutputChannels() != newNumOuts)
success &= setChannelLayoutOfBus (false, 0, AudioChannelSet::canonicalChannelSet (newNumOuts));
// failed to find a compatible output configuration
jassert (success); //line 356
// if the user is using this method then they do not want any side-buses or aux outputs
success &= disableNonMainBuses();
jassert (success);
// the processor may not support this arrangement at all
jassert (success && newNumIns == getTotalNumInputChannels() && newNumOuts == getTotalNumOutputChannels());
setRateAndBufferSizeDetails (newSampleRate, newBlockSize);
ignoreUnused (success);
}
结果是AudioDeviceManager
在我的处理器上调用setPlayConfigDetails
(上面的函数),这会给出断言,因为我的AudioProcessor上没有输入
如果我将输入添加到HelloSamplerAudioProcessor
,它将不再断言,但我会得到一个回音,即使我禁用了输入。无论如何,我不需要它,我不需要给我的音频处理器添加输入,我只想从它的样本中输出音频
我应该如何在Juce中制作一个只需播放
音频处理器的独立应用程序?
我认为Juce论坛是解决这个问题的最佳场所。另外,作为boiler plate插件项目的一部分,还有一个独立的二进制文件。也许有必要说明为什么这还不够
void AudioProcessor::setPlayConfigDetails (int newNumIns, int newNumOuts, double newSampleRate, int newBlockSize)
{
bool success = true;
if (getTotalNumInputChannels() != newNumIns)
success &= setChannelLayoutOfBus (true, 0, AudioChannelSet::canonicalChannelSet (newNumIns));
// failed to find a compatible input configuration
jassert (success); //line 350
if (getTotalNumOutputChannels() != newNumOuts)
success &= setChannelLayoutOfBus (false, 0, AudioChannelSet::canonicalChannelSet (newNumOuts));
// failed to find a compatible output configuration
jassert (success); //line 356
// if the user is using this method then they do not want any side-buses or aux outputs
success &= disableNonMainBuses();
jassert (success);
// the processor may not support this arrangement at all
jassert (success && newNumIns == getTotalNumInputChannels() && newNumOuts == getTotalNumOutputChannels());
setRateAndBufferSizeDetails (newSampleRate, newBlockSize);
ignoreUnused (success);
}