Jai du son sur le simulateur et pas sur Ipad
HAAAA je deviens fou, j'ai suivi pas à pas le tutoriel suivant
[ame="http://www.youtube.com/watch?v=dcLcZqJsHMc"][/ame]
ce programme fonctionne correctement en mode simulateur mais pas en mode device sur l'IPAD
voici mon code
pour le .m
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19
|
#import "TestSon2fileViewController.h"
#import <AVFoundation/AVFoundation.h>
@implementation TestSon2fileViewController
- (IBAction)playSound1 {
NSString *path=[[NSBundle mainBundle] pathForResource:@"gagne01" ofType:@"mp3"];
AVAudioPlayer* theAudio=[[AVAudioPlayer alloc] initWithContentsOfURL : [NSURL fileURLWithPath: path] error:NULL];
theAudio.delegate=self;
[theAudio play];
}
- (IBAction)playSound2 {
NSString *path=[[NSBundle mainBundle] pathForResource:@"perdu1" ofType:@"mp3"];
AVAudioPlayer* theAudio=[[AVAudioPlayer alloc] initWithContentsOfURL : [NSURL fileURLWithPath: path] error:NULL];
theAudio.delegate=self;
[theAudio play];
} |
et pour le .h
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13
|
#import <UIKit/UIKit.h>
@interface TestSon2fileViewController : UIViewController {
}
- (IBAction)playSound1;
- (IBAction)playSound2;
@end |
sachant qu'avant j'avais essayé de jouer du son AudioToolbox et que j'avais le même problême est qu'il est possible que j'ai un problème avec mon IPAD ou une initialisation mal faite ?