나는 아이폰과 목표 C로 새로운데, 지금까지 몇 가지 작은 예제를 코딩 할 수 있었다.소리를 내고, 연주를 끝내고 (iPhone) 계속하기를 기다린다.
샘플이 재생이 끝나면 나는 사운드를 재생하고, 코드의 나머지 부분을 계속하고 싶습니다 예 :
printf("hello");
playASound["file.wav"];
printf("world");
사실은 내가 받고 있어요 : 인쇄 인사에서 파일 및 인쇄 세상을 연주 같은 시간에 하지만 내가 원하는 건 : 안녕하세요, 파일을 재생, 인쇄 세계 ... 그럼, 어떻게해야합니까?
감사합니다.
btw입니다.
-(void) playASound: (NSString *) file {
//Get the filename of the sound file:
NSString *path = [NSString stringWithFormat:@"%@/%@",
[[NSBundle mainBundle] resourcePath],
file];
SystemSoundID soundID;
//Get a URL for the sound file
NSURL *filePath = [NSURL fileURLWithPath:path isDirectory:NO];
AudioServicesCreateSystemSoundID((CFURLRef)filePath, &soundID);
//play the file
AudioServicesPlaySystemSound(soundID);
}
+1이 또한 저에게 도움이됩니다 –
감사합니다 Nicholas – subzero
"경로"가 자동으로 해제 되나요? –