ios 声音学习

自己要准备一个声音文件,这里是wav的

NSString *path = [[NSBundle mainBundle] pathForResource:@"msgcome" ofType:@"wav"];
    NSURL *url = [NSURL fileURLWithPath:path];
    
    SystemSoundID soundId;
    AudioServicesCreateSystemSoundID((CFURLRef)url, &soundId);
    AudioServicesPlaySystemSound(soundId);



你可能感兴趣的:(ios 声音学习)