There's could be a in my apps cause when I tried to build it in iPhone device, i cannot hear a sound and i couldn't also use the volume button of the device.. while when i build it in simulator it works perfectly.. I tried using the code below but it didn't work also.. Can somebody help me in here.. Thanks..
UInt32 audioRouteOverride = kAudioSessionOverrideAudioRoute_Speaker;
AudioSessionSetProperty (kAudioSessionProperty_OverrideAudioRoute,sizeof (audioRouteOverride),&audioRouteOverride);
NSString *soundPath = [[NSBundle mainBundle] pathForResource:@"sounds" ofType:@"wav"];
AVAudioPlayer *soundPlay = [[AVAudioPlayer alloc] initWithContentsOfURL:[NSURL fileURLWithPath:soundPath] error:NULL];
soundPlay.volume = 1.0;
self->puzzSFX = soundPlay;
soundPlay.numberOfLoops = 0;
if ([soundPlay currentTime] != 0) [soundPlay setCurrentTime:0];
[soundPlay play];
soundPlay.delegate = self;
PS: I tried to adjust the volume through the headphone and then poof it will start working..