[問題] 在模擬器上有聲音進手機卻沒有聲音?!
以下是我的程式碼
-(IBAction)touchbutton1
{
CFBundleRef mainBundle = CFBundleGetMainBundle();
CFURLRef soundFileURLRef;
soundFileURLRef = CFBundleCopyResourceURL(mainBundle, (CFStringRef) @"hit5",
CFSTR("wav"),NULL);
UInt32 soundID;
AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID);
AudioServicesPlaySystemSound(soundID);
}
我用simulator跑,按下按鈕後是有聲音的,
但進到手機裡後卻沒聲音了
我用AVAudioPlayer放背景音樂在simulator和手機裡都是OK的
但這個button卻沒聲音
為什麼會這樣呢?!
麻煩大家了,謝謝!!
--
※ 發信站: 批踢踢實業坊(ptt.cc)
◆ From: 114.33.77.78
※ 編輯: lovemynina 來自: 114.33.77.78 (10/12 00:54)
※ 編輯: lovemynina 來自: 114.33.77.78 (10/12 00:55)
→
10/12 12:19, , 1F
10/12 12:19, 1F
推
10/12 14:38, , 2F
10/12 14:38, 2F
→
10/12 19:35, , 3F
10/12 19:35, 3F
→
10/12 23:17, , 4F
10/12 23:17, 4F
→
10/12 23:18, , 5F
10/12 23:18, 5F
→
10/13 01:03, , 6F
10/13 01:03, 6F
→
10/13 01:35, , 7F
10/13 01:35, 7F
→
10/13 01:36, , 8F
10/13 01:36, 8F
→
10/13 01:37, , 9F
10/13 01:37, 9F
→
10/13 01:39, , 10F
10/13 01:39, 10F
→
10/13 03:11, , 11F
10/13 03:11, 11F
→
10/13 03:13, , 12F
10/13 03:13, 12F
討論串 (同標題文章)
以下文章回應了本文:
完整討論串 (本文為第 1 之 2 篇):
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章