Help guy : 저는 AVAudioPlayer로 오디오를 얻으려고 모든 노력을했습니다. 어떤 이유로 iPhone 시뮬레이터에서 재생되지 않습니다. 코드는 다음과 같습니다.내 앱에서 오디오가 작동하지 않는 것 같습니까? AVAudio 프레임 워크를 사용하고 있습니다.
#import "ViewController.h"
#import "AVFoundation/AVFoundation.h"
@interface ViewController()
{
AVAudioPlayer *avPlayer;
}
@end
@implementation ViewController
@synthesize myProgressView;
@synthesize sliderVolumeOutlet;
- (void)viewDidLoad
{
[super viewDidLoad];
NSString *stringPath = [[NSBundle mainBundle]pathForResource:@"audioapp" ofType:@"mp3"];
NSURL *url = [NSURL fileURLWithPath:stringPath];
NSError *error;
avPlayer = [[AVAudioPlayer alloc]initWithContentsOfURL:url error:&error];
[avPlayer setNumberOfLoops:1];
[avPlayer setVolume:self.sliderVolumeOutlet.value];
[NSTimer scheduledTimerWithTimeInterval:.1 target:self selector:@selector(updateProgress) userInfo:nil repeats:YES];
}
노래 자체가 프로젝트 파일에 있습니다. 실제로 내가 잘못하고있는 것을 실제로 알지 못합니다.
하지 엑스 코드 질문 해보십시오. –