2014-01-24 2 views
0

다음 코드에서 오류는 발생하지 않지만 여전히 오디오를 재생하지 않습니다.
내가 뭘 잘못하고 있니?클릭 버튼에서 오디오가 재생되지 않음

-(IBAction)buttonPressed:(id)sender 
{ 
    UIAlertView *alert = [[UIAlertView alloc]initWithTitle: @"ABC" 
                message: @" ABC" 
                delegate: self 
             cancelButtonTitle:@"Cancel" 
             otherButtonTitles:@"OK",nil]; 

    [alert show]; 

    AVAudioPlayer *audioplayer; 
    NSString *audiopath = [[NSBundle mainBundle] pathForResource:@ "1Abhi Kuch Dino Se.mp3" ofType:@ "mp3"]; 
    NSURL *audioURL = [NSURL fileURLWithPath:audiopath]; 
    audioplayer = [[AVAudioPlayer alloc]initWithContentsOfURL:audioURL error:nil]; 
    [audioplayer play]; 
} 

답변

1

시도해보십시오. 경로 리소스에서 .mp3을 제거하십시오.

NSString *audiopath =[[NSBundle mainBundle] pathForResource:@ "1Abhi Kuch Dino Se" ofType:@ "mp3"]; 
관련 문제