Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/xml/15.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 播放音频处理器的最简单的独立JUCE应用程序?_C++_Audio_Signal Processing_Juce - Fatal编程技术网

C++ 播放音频处理器的最简单的独立JUCE应用程序?

C++ 播放音频处理器的最简单的独立JUCE应用程序?,c++,audio,signal-processing,juce,C++,Audio,Signal Processing,Juce,我找到的所有JUCE教程和音频处理器示例都是插件。如果我想创建自己的应用程序,不带插件,播放音频处理器,该怎么办 例如: HelloSamplerAudioProcessor::HelloSamplerAudioProcessor() : AudioProcessor (BusesProperties() .withOutput("Output", juce::AudioChannelSet::stereo(), true) 我正在将

我找到的所有JUCE教程和音频处理器示例都是插件。如果我想创建自己的应用程序,不带插件,播放
音频处理器
,该怎么办

例如:

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);
}