ofBaseSoundPlayer missing, ofxSoundObject examples don't work

Hello everyone. I’m trying to run the ofxFft example from ofxSoundObject but am getting the error:

/oF/addons/ofxBasicSoundPlayer/src/ofxBasicSoundPlayer.h:10:10: fatal error: ofBaseSoundPlayer.h: No such file or directory
 #include "ofBaseSoundPlayer.h"

I have the ofxBasicSoundPlayer plugin and the ofxFft plugin and I’m using openFrameworks 0.10.0. I noticed there is no longer an ofBaseSoundPlayer.h file in libs/openFrameworks/sound/ (but there was in earlier version) so I tried using an older version but got the same error.

If someone has any advice on other methods of getting simple sound analysis for files that would also be appreciated.

sorry, I didn’t update that example. I will do now. I’ll let you know.

Hi @Delysel I’ve updated ofxSoundObjects. Not the fft example works. Please note that you’ll need to download ofxAudioFile in order to make it work.

1 Like

Thanks! I tried the ofxFft example but now I get two new errors:

/home/me/oF/addons/ofxSoundObjects/src/ofxSoundFile.h:67:22: error: field ‘playheadControl’ has incomplete type ‘std::atomic<double>’
  std::atomic<double> playheadControl;


/home/me/oF/addons/ofxSoundObjects/src/ofxSoundFile.cpp: In member function ‘bool ofxSoundFile::readTo(ofSoundBuffer&, uint64_t)’:
/home/me/oF/addons/ofxSoundObjects/src/ofxSoundFile.cpp:193:1: error: no return statement in function returning non-void [-Werror=return-type]

Commenting the line from the first error and setting the function in the second error to always return true makes me able to run the example but when I load a file there is some noise added when playing it.

Ohh sorry.
I’ve updated it.
At least it is compiling and working on my computer

That solved it for me, thanks a lot! I really appreciate it.

I still heard the noise but I think I’ve solved that too now. In the example, the ofSoundStream is setup with:

stream.setup(2, 2, 44100, bufferSize, 4);

I’m not completely sure about all the underlying sound stuff in oF but with just that, the program will default to using ALSA for sound (I’m using Linux). Creating an ofSoundStreamSettings object like this:

ofSoundStreamSettings settings;
double sampleRate = 44100.0;
settings.sampleRate = sampleRate;
settings.numOutputChannels = 2;
settings.numInputChannels = 2;
settings.bufferSize = bufferSize;

where the important part is the last line where I tell oF to use PulseAudio as the sound API, and then setting up the ofSoundStream with


seem to have done the trick.

1 Like