ofxALSoundPlayer length (number of samples)

Hi Zach Gage and others,

I was wondering if there is anyway of finding out the number of samples using the ofxALSoundPlayer class. The core ofSoundPlayer class has "length’ as a variable but the ofxALSoundPlayer doesn’t

Anyone know how to get this ?

I’ve written an OpenAL based sound player which tries to replace the functionality of ofSoundPlayer. It has “length” (in samples) and “duration” variables in the class. Check out the loadSound function in ofxSoundPlayerOpenAL.cpp for more details.
More info here:
http://forum.openframeworks.cc/t/new-openal-based-ofsoundplayer/2920/1
http://code.google.com/p/digitalstarcode/downloads/list

Hi Grimus,
Thanks for the response.
I downloaded your ofxSoundPlayerExample and it runs fine in OF v0.06.

I installed the classes in an iphone project i am working on (running iOS 3.2 SDK) and I get these link errors. Any Ideas?

“_AudioComponentFindNext”, referenced from:
ofSoundStreamSetup(int, int, ofBaseApp*, int, int, int)in libofxiPhoneOFLib_iphonesimulator _Release.a(ofxiPhoneSoundStream.o)
“_AudioOutputUnitStart”, referenced from:
ofSoundStreamStart() in libofxiPhoneOFLib_iphonesimulator _Release.a(ofxiPhoneSoundStream.o)
“_AudioUnitUninitialize”, referenced from:
ofSoundStreamClose() in libofxiPhoneOFLib_iphonesimulator _Release.a(ofxiPhoneSoundStream.o)
“_AudioSessionSetActive”, referenced from:
ofSoundStreamSetup(int, int, ofBaseApp*, int, int, int)in libofxiPhoneOFLib_iphonesimulator _Release.a(ofxiPhoneSoundStream.o)
“_AudioUnitSetProperty”, referenced from:
ofSoundStreamSetup(int, int, ofBaseApp*, int, int, int)in libofxiPhoneOFLib_iphonesimulator _Release.a(ofxiPhoneSoundStream.o)
ofSoundStreamSetup(int, int, ofBaseApp*, int, int, int)in libofxiPhoneOFLib_iphonesimulator _Release.a(ofxiPhoneSoundStream.o)
ofSoundStreamSetup(int, int, ofBaseApp*, int, int, int)in libofxiPhoneOFLib_iphonesimulator _Release.a(ofxiPhoneSoundStream.o)
ofSoundStreamSetup(int, int, ofBaseApp*, int, int, int)in libofxiPhoneOFLib_iphonesimulator _Release.a(ofxiPhoneSoundStream.o)
ofSoundStreamSetup(int, int, ofBaseApp*, int, int, int)in libofxiPhoneOFLib_iphonesimulator _Release.a(ofxiPhoneSoundStream.o)
ofSoundStreamSetup(int, int, ofBaseApp*, int, int, int)in libofxiPhoneOFLib_iphonesimulator _Release.a(ofxiPhoneSoundStream.o)
ofSoundStreamSetup(int, int, ofBaseApp*, int, int, int)in libofxiPhoneOFLib_iphonesimulator _Release.a(ofxiPhoneSoundStream.o)
“_AudioOutputUnitStop”, referenced from:
ofSoundStreamStop() in libofxiPhoneOFLib_iphonesimulator _Release.a(ofxiPhoneSoundStream.o)
“_AudioSessionInitialize”, referenced from:
ofSoundStreamSetup(int, int, ofBaseApp*, int, int, int)in libofxiPhoneOFLib_iphonesimulator _Release.a(ofxiPhoneSoundStream.o)
“_AudioSessionSetProperty”, referenced from:
ofSoundStreamSetup(int, int, ofBaseApp*, int, int, int)in libofxiPhoneOFLib_iphonesimulator _Release.a(ofxiPhoneSoundStream.o)
ofSoundStreamSetup(int, int, ofBaseApp*, int, int, int)in libofxiPhoneOFLib_iphonesimulator _Release.a(ofxiPhoneSoundStream.o)
“_AudioComponentInstanceNew”, referenced from:
ofSoundStreamSetup(int, int, ofBaseApp*, int, int, int)in libofxiPhoneOFLib_iphonesimulator _Release.a(ofxiPhoneSoundStream.o)
“_AudioUnitInitialize”, referenced from:
ofSoundStreamSetup(int, int, ofBaseApp*, int, int, int)in libofxiPhoneOFLib_iphonesimulator _Release.a(ofxiPhoneSoundStream.o)
“_AudioUnitRender”, referenced from:
recordingCallback(void*, unsigned long*, AudioTimeStamp const*, unsigned long, unsigned long, AudioBufferList*)in libofxiPhoneOFLib_iphonesimulator _Release.a(ofxiPhoneSoundStream.o)
ld: symbol(s) not found
collect2: ld returned 1 exit status