/ Published in: Objective C
Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
SystemSoundID systemSoundID; OSStatus err; err = AudioServicesCreateSystemSoundID((CFURLRef) fileURL, &systemSoundID); if(err){ NSLog(@"AudioServicesCreateSystemSoundID err = %d",err); return; } // systemSoundCompletionProcFunctionã¯ã‚µã‚¦ãƒ³ãƒˆã‚™å†ç”Ÿå®Œäº†æ™‚ã«å‘¼ã²ã‚™å‡ºã•ã‚Œã‚‹ã‚³ãƒ¼ãƒ«ãƒã‚™ãƒƒã‚¯é–¢æ•° AudioServicesAddSystemSoundCompletion(systemSoundID, NULL, NULL, systemSoundCompletionProcFunction, NULL); // コールãƒã‚™ãƒƒã‚¯é–¢æ•°ã‚’削除 //AudioServicesRemoveSystemSoundCompletion(systemSoundID); // å†ç”Ÿé–‹å§‹ AudioServicesPlaySystemSound(systemSoundID); }