2
votes

I'm trying to play an audio file in a cocos2d application. Here is the line which tries to play the sound:

[[SimpleAudioEngine sharedEngine] playEffect:@"pig_squeal.wav"];

If I put a log near this line, the log appears, and I can play the sound with iTunes. But when the sound should be played, there is a message displayed:

AudioStreamBasicDescription: 2 ch, 44100 Hz, 'lpcm' (0x00000C2C) 8.24-bit little-endian signed integer, deinterleaved

What's the problem?

5
That's not an error message, just some information. Does the sound play?James Webster
No. No sound is playing.MMMM
Is the sound definitely in your library and a part of the target?James Webster
You haven't changed the volume of the SimpleAudioEngine or the volume of your device isn't all the way down?James Webster
It is added, it can be played inside the xCode too, only with the simulator not, neither with the device.MMMM

5 Answers

1
votes

This was discussed in comments but I've amalgamated all the possibilities of why it may not work here.:

  • That's not an error message, just some information.

  • Is the sound definitely in your library and a part of the target?

  • You haven't changed the volume of the SimpleAudioEngine or the volume of your device isn't all the way down?

    • Click the sound in your library. Press Option+Command+1 to bring up the file editor. Scroll down to "Target Membership" and ensure the sound is checked for your target.
  • Try a different sound effect too? Try and narrow the problem down to "is it SimpleAudioEngine".

  • Also try and playBackgroundMusic for a sound (This was the solution in this case)

  • And try an mp3
0
votes

There isn't a problem. It's a status message written to the log when you initialise the current OpenAL context using alcMakeContextCurrent. As far as I'm aware, you can't get rid of the message.

0
votes

There is no problems with your code for the Playing of the Sound. Please check the Sound file has been added to the project also do check the format of the sound. It should play the Sound whenever you call the Play Effect. Please also try to PRELOAD the sound effect in the init method.

0
votes

that message means the song was read correctly and should be playing. possible reasons you don't hear it?

  • volume turned down.
  • device malfunctioning
  • audio has silence in it
  • audio file is large and will take a long time to load.
  • sound has been redirect to come out of the headphones or the ear piece (even if not attached)

But the sound is loading and most likely playing.

0
votes

If you are getting a crash while running in device from xcode pls try this(worked for me). Dissconnect the device from Xcode and run the app in the device. I dont know why it worked like that. But when I did this there was no crash.