OpenAl fail on 3GS

Nibbie
Posts: 4
Joined: 2010.01
Post: #1
Hi all,

Have a problem that I can't find any info on: I developed a game on my iPhone 3G, and got it up on iTunes with no hassles. The problem is my friend with a 3GS bought the game, and sound doesn't work at all.

I use exclusively OpenAl to play sound files, and it all works fine on my 3G. I followed Apple's example code and Ben Britten's tutorial (which breaks things down really nicely!). I did use the WAV format instead of CAF for my sounds. Could that be causing the problem? Or could it be something else? Thanks for taking the time to read.
Quote this message in a reply
Moderator
Posts: 3,577
Joined: 2003.06
Post: #2
The WAV format shouldn't have anything to do with it playing on one device and not another. The first question that pops into my mind is: did you set the audio session?
Quote this message in a reply
Nibbie
Posts: 4
Joined: 2010.01
Post: #3
Thanks for replying, AnotherJake.

Here's my code to set up the audio session:

Code:
OSStatus result = AudioSessionInitialize(NULL, NULL, NULL, NULL);
    if(result)
    {
        printf("Problem setting up the audio session! %d\n", result);
    }
    
    UInt32    category = kAudioSessionCategory_AmbientSound;
    
    // Set the category property for the session
    result = AudioSessionSetProperty(kAudioSessionProperty_AudioCategory, sizeof(category), &category);
    if(result)
    {
        printf("Couldn't set audio session category! %d\n", result);
    }
    
    // Activate the audio session
    result = AudioSessionSetActive(TRUE);
    if(result)
    {
        printf("Couldn't activate audio session! %d\n", result);
    }

Obviously my error checking code is mostly usesless. Anything here look suspicious? I know I'm not providing an audio interruption callback, which is surely not ideal.
Quote this message in a reply
Moderator
Posts: 3,577
Joined: 2003.06
Post: #4
Hmm... Well, that looks like it should at least work. I'm stumped, for the moment, but very interested in this because it sounds strange, and worrisome too! There really shouldn't be anything killing sound across different devices that I can think of. Did you check the apple dev board? Any other places? I know it might be a hassle, but it might be nice if you could put together a basic audio test app to send to your friend Ad Hoc and see if you can get audio working at all on his device.
Quote this message in a reply
Nibbie
Posts: 4
Joined: 2010.01
Post: #5
Hi again 'notherJake,

Yeah, it does seem weird to me, too. I should get the chance to run my game through Xcode on my friend's 3GS soon, so hopefully that'll allow me to figure this out. If I had the funds, I'd just go buy a 3GS tomorrow, but I can't really do that! Thanks again for your time. I'll definitely report back with any news.
Quote this message in a reply
Moderator
Posts: 3,577
Joined: 2003.06
Post: #6
Good luck with it! Yes, it'd definitely be nice to hear back on anything more you can find out about this issue. Smile
Quote this message in a reply
Nibbie
Posts: 4
Joined: 2010.01
Post: #7
Ah, heck. I'd like to just leave it at that! But, to explain: my friend, who is an intelligent person and a successful business owner, had his silent switch on. That's all. Sorry to mislead anybody. I guess this is an object lesson in the dangers of assuming anything whatsoever.
Quote this message in a reply
Moderator
Posts: 3,577
Joined: 2003.06
Post: #8
Aha! Definitely appreciate that you came back to let us know about that. While it might seem silly, and a waste of time, it really isn't. Some other developer might be having the exact same problem and see this thread and it'll save them the hassle. The silent switch being off didn't occur to me either, to be honest. Wink
Quote this message in a reply
Post Reply 

Possibly Related Threads...
Thread: Author Replies: Views: Last Post
  OpenGL Flip buffer sometimes fail SunHpp 4 6,983 Jul 25, 2008 04:03 PM
Last Post: Frogblast