开发者

Record with AudioToolBox

开发者 https://www.devze.com 2023-04-01 15:15 出处:网络
I am playing sounds when a user click on buttons with this method : NSString *path = [NSString stringWithFormat: @\"%@/%@\",[[NSBundle mainBundle] resourcePath], name];

I am playing sounds when a user click on buttons with this method :

NSString *path = [NSString stringWithFormat: @"%@/%@",[[NSBundle mainBundle] resourcePath], name];
NSURL* filePath = [NSURL fileURLWithPath: path isDirectory: NO];
SystemSoundID soundID;
AudioServicesCreateSystemSoundID((CFURLRef)filePath, &soundID);
AudioServicesPlaySystemSound(soundID);

can 开发者_Go百科i record a set of sounds that i play to a file.

0

精彩评论

暂无评论...
验证码 换一张
取 消

关注公众号