Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/cplusplus/138.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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/typo3/2.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++ Cinder和Clion:BufferPlayerNode不输出声音_C++_Audio_Core Audio_Clion_Cinder - Fatal编程技术网

C++ Cinder和Clion:BufferPlayerNode不输出声音

C++ Cinder和Clion:BufferPlayerNode不输出声音,c++,audio,core-audio,clion,cinder,C++,Audio,Core Audio,Clion,Cinder,煤渣新手。试图找出我的BufferPlayerNode工作不正常的原因。一切都已编译,GainNodeRef的音量(1.0f)正确,但我听不到电脑播放的任何声音:皱眉: 下面是代码片段: auto ctx = audio::Context::master(); audio::SourceFileRef source_file = audio::load(loadAsset("tanpura_C.mp3"), ctx->getSampleRate()); //creat

煤渣新手。试图找出我的BufferPlayerNode工作不正常的原因。一切都已编译,GainNodeRef的音量(1.0f)正确,但我听不到电脑播放的任何声音:皱眉:

下面是代码片段:

auto ctx = audio::Context::master();
audio::SourceFileRef source_file = audio::load(loadAsset("tanpura_C.mp3"), ctx->getSampleRate());

//create BufferPlayerNode from file
buffer_player = ctx->makeNode(new audio::BufferPlayerNode());
buffer_player->loadBuffer(source_file);

//create GainNode for volume control, set to max volume
audio::GainNodeRef gain = ctx->makeNode(new audio::GainNode(1.0f));

// Connect player components to audio graph
buffer_player >> gain >> ctx->getOutput();

std::cout << gain->getValue();
ctx->enable();
buffer_player->start();
auto-ctx=audio::Context::master();
audio::SourceFileRef source_file=audio::load(loadAsset(“tanpura_C.mp3”),ctx->getSampleRate();
//从文件创建BufferPlayerNode
buffer_player=ctx->makeNode(新音频::BufferPlayerNode());
buffer\u player->loadBuffer(源文件);
//为音量控制创建增益节点,设置为最大音量
音频::GainNodeRef增益=ctx->makeNode(新音频::GainNode(1.0f));
//将播放器组件连接到音频图形
buffer_player>>增益>>ctx->getOutput();
std::cout getValue();
ctx->enable();
buffer_player->start();
有谁能给我指点一下我在这里可能会出什么差错?非常感谢你

我在MacOS Catalina上使用Cinder v0.9.1和Clion 2021.1.1,如果这有帮助的话