我需要在线程中运行AudioServicesCreateSystemSoundID吗

我需要在线程中运行AudioServicesCreateSystemSoundID吗,ios,objective-c,xcode,ios6,Ios,Objective C,Xcode,Ios6,我使用AudioServicesCreateSystemSoundID来播放声音,它工作正常,只是我不确定是否需要在线程块上运行它,或者它本身在自己的线程上运行 我只是担心如果我的应用程序运行在主线程上,它可能会使我的应用程序没有响应 NSURL *tapSound = [[NSBundle mainBundle] URLForResource: @"mysound" withExtension:

我使用AudioServicesCreateSystemSoundID来播放声音,它工作正常,只是我不确定是否需要在线程块上运行它,或者它本身在自己的线程上运行

我只是担心如果我的应用程序运行在主线程上,它可能会使我的应用程序没有响应

NSURL *tapSound   = [[NSBundle mainBundle] URLForResource: @"mysound"
                                                withExtension: @"aiff"];

    // Store the URL as a CFURLRef instance
    //   soundFileURLRef = (__bridge CFURLRef) tapSound ;

    // Create a system sound object representing the sound file.

     SystemSoundID  soundFileObject;

    AudioServicesCreateSystemSoundID (

                                      (__bridge_retained CFURLRef) tapSound,
                                      &soundFileObject
                                      );
    // AudioServicesPlayAlertSound (soundFileObject);
    AudioServicesPlaySystemSound (soundFileObject);

声音将异步播放。您不需要在自己的线程中运行它。

声音将异步播放。您不需要在自己的线程中运行它