Audio and FilePlayerNode

#1

Hello everyone,

I started working on the sound part of my game recently. I’m using cinder 0.9.0 and Visual Studio 2017.
I have read the Audio API Guide and decided to go for the FilePlayerNode class as i want to loop my soundtrack.

Here is my code :

audio::FilePlayerNodeRef stanza;

{
audio::SourceFileRef sourceFile = audio::load(loadAsset(“stanza.wav”));
auto ctx = audio::Context::master();
stanza = ctx->makeNode(new audio::FilePlayerNode(sourceFile));
stanza->setLoopEnabled();
}

And i got this error :
‘void cinder::audio::Node::setContext(const cinder::audio::ContextRef &)’ : impossible ton convert argument 1 of ‘std::shared_ptr<_Ty>’ in ‘const cinder::audio::ContextRef &’

Thanks for the help.

0 Likes

#2

Hi,

The snipped you posted builds for me with gcc. Are you sure the error is at these lines?

-Gabor

0 Likes

#3

The error goes to Context.h line 182, a source file of audio.

0 Likes

#4

Hi there,

This is Context.h line 182, which is not in a function. If you try to make your problem clearer and post complete error statements, we might be able to help you.

cheers,
Rich

0 Likes