OpenAL alGenSources error

Apprentice
Posts: 14
Joined: 2015.01
Post: #1
I was recently given some code by a friend that's meant to convert then play and analyze music, but when I have tried integrating it into my own project, it is throwing errors and refusing to play the music.

I've tracked the flow of the code and found the first line where it disagrees from the original.

#define AL_CALL(a) { a; checkError(__FILE__, __LINE__); }
bool PcmStream::open(string path){
printf("PcmStream %s", path.c_str());
fp = fopen(path.c_str(), "rb");
if(!fp){
printf("Audio file at path %s is missing", path.c_str());
return false;
}
fseek(fp, 0L, SEEK_END);
file_size = ftell(fp);
fseek(fp, 0L, SEEK_SET);
printf("File size %lu Bytes", file_size);

AL_CALL(alGenBuffers(BUFFERS_NUMBER, buffers));
AL_CALL(alGenSources(1, &source));
printf("\n \n First error %u \n \n", *buffers);

printf("\n \n Second error %d \n \n", source);
This outputs: BytesOpenAL error 40964 at /Users/justking14/projectname/template/multi-platform-cpp/proj.ios/PcmStreamer.cpp 61

First error 2496

Second error 0

*buffers always gives the same number on this project and a different, but constant number on the original code.

Source always gives the same number on the original, but on my code it gives anything between 0 and 2089734272.

I'd really appreciate any and all feedback on what I'm doing wrong.
Quote this message in a reply
Apprentice
Posts: 14
Joined: 2015.01
Post: #2
Turns out the shared SimpleAudioEngine I was using was blocking the audio ports.
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  OpenAL alGenSources failing captainfreedom 1 5,085 May 26, 2009 07:45 AM
Last Post: captainfreedom