|
|
#1 |
|
Sound is not playing on iOS 6 iPhone 5
The sound is not playing for
![]() - iOS 6 iPhone 5 - iOS 5 iPhone 4 but working fine on iPad 2 and iPhone 3GS ![]() Code:
- (void)playSound
{
// read the sound file from resources and play it on successful scanning
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"scan_beep" ofType:@"wav"];
NSURL *fileURL = [NSURL fileURLWithPath:filePath];
AudioServicesCreateSystemSoundID((CFURLRef)fileURL, &systemSoundID);
AudioServicesPlayAlertSound(systemSoundID);
}
I call the above function when I scan the barcode in my sample app.
__________________
Finite Disappointment Vs Infinite Hope |
|
|
|
0
|
|
|
#2 | |
|
Quote:
__________________
. |
||
|
|
0
|
|
|
#3 | |
|
Quote:
__________________
Finite Disappointment Vs Infinite Hope |
||
|
|
0
|
|
|
#4 |
|
This works for me:
Code:
NSURL *path = [[NSBundle mainBundle] URLForResource: @"scan_beep"
withExtension: @"wav"];
self.soundFileURLRef = (__bridge CFURLRef) path;
AudioServicesCreateSystemSoundID (
soundFileURLRef,
&beep
);
attention to case. Is your sound file .wav or .WAV? |
|
|
|
0
|
|
|
#5 |
|
png files?
__________________
|
|
|
|
0
|
|
|
#6 |
|
Loading png (image) files from main bundle to a UIImage has on more
than one occasion, worked on one device/iOS and not another for me. I had to change Code:
UIImage *myImage = [UIImage imageNamed:@"Sun.png"]; Code:
UIImage *myImage = [UIImage imageNamed:@"Sun.PNG"]; |
|
|
|
0
|
|
|
#7 | |
|
If you always pay attention to case, you don't need to worry about it.
Quote:
__________________
|
||
|
|
0
|
|
|
#8 | |
|
Quote:
Very strange, same code is running perfect in iPad 2, iPod Touch 4th Gen, iPhone 3GS but not in iPhone 4 and iPhone 5
__________________
Finite Disappointment Vs Infinite Hope |
||
|
|
0
|
|
|
#9 |
|
Try:
Code:
AudioServicesPlaySystemSound (systemSoundID); Code:
AudioServicesPlayAlertSound(systemSoundID); program launch rather than loading the sound to memory every time you play it. EDIT,, Also on the iPhone 4 & 5, try: Code:
AudioServicesPlaySystemSound (kSystemSoundID_Vibrate); Last edited by xArtx; Jan 14, 2013 at 12:52 AM. |
|
|
|
0
|
|
|
#10 |
|
Tried whatever you guys suggested !!
let me remind my issue, with following code I test my application on following devices: - iPhone 5 iOS 6 - iPhone 4S iOS 6 - iPhone 4 iOS 5 - iPad 2 iOS 5 - iPhone 3GS not remember its iOS Version Code:
- (void)playSound
{
// read the sound file from resources and play it on successful scanning
NSString *filePath = [[NSBundle mainBundle] pathForResource:@"scan_beep" ofType:@"wav"];
NSURL *fileURL = [NSURL fileURLWithPath:filePath];
AudioServicesCreateSystemSoundID((CFURLRef)fileURL, &systemSoundID);
AudioServicesPlayAlertSound(systemSoundID);
}
__________________
Finite Disappointment Vs Infinite Hope |
|
|
|
0
|
![]() |
|
«
Previous Thread
|
Next Thread
»
| Thread Tools | Search this Thread |
| Display Modes | |
|
|
All times are GMT -5. The time now is 06:55 AM.









Linear Mode
