Please make use of the code=cpp tag, when posting code.

SoundBuffer buffer = manager.getBuffer();
COPY!

If you return a reference you don't need to crate a local variable, but you can directly use it.
sound.setBuffer(manager.getBuffer());
Or if you really want a local variable, you'll have to use a reference.
SoundBuffer& buffer = manager.getBuffer();
sound.setBuffer(buffer);