ios 聲音學習

本身要準備一個聲音文件,這裏是wav的 url

NSString *path = [[NSBundle mainBundle] pathForResource:@"msgcome" ofType:@"wav"];
    NSURL *url = [NSURL fileURLWithPath:path];
    
    SystemSoundID soundId;
    AudioServicesCreateSystemSoundID((CFURLRef)url, &soundId);
    AudioServicesPlaySystemSound(soundId);
相關文章
相關標籤/搜索