一、系统音效列表
GitHub地址:https://github.com/YouXianMing/iOS-General-Tools
我想说的是这个列表有个bug,获取列表的时候,应该在主线程获取,这样才能把列表展示完全。否则每次获取到的列表条数可能不一样。
这个demo可以展示很多iOS系统音效列表来进行试音
#import "SystemSound.h"
#import <AudioToolbox/AudioToolbox.h>
static NSMutableArray *_systemSounds = nil;
@implementation SystemSound
+ (void)accessSystemSoundsList {
static dispatch_once_t predicate;
dispatch_once(&predicate, ^{
dispatch_async(dispatch_get_global_queue(DISPATCH_QUEUE_PRIORITY_DEFAULT, 0), ^{
NSMutableArray *audioFileList = [NSMutableArray array];
_systemSounds = [NSMutableArray array];
// 读取文件系统
NSFileManager *fileManager = [[NSFileManager alloc] init];