Re: [問題] 在模擬器上有聲音進手機卻沒有聲音?!
AudioServicesCreateSystemSoundID是有return type的
OSStatus status = AudioServicesCreateSystemSoundID(soundFileURLRef, &soundID);
然後看一下status是什麼?
代碼請見System Sound Services Reference -> Result Codes
http://tinyurl.com/9ag6vnm
※ 引述《lovemynina (nini)》之銘言:
: 以下是我的程式碼
: -(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: 199.2.242.199
推
10/14 00:49, , 1F
10/14 00:49, 1F
→
10/14 04:07, , 2F
10/14 04:07, 2F
→
10/14 20:38, , 3F
10/14 20:38, 3F
討論串 (同標題文章)
本文引述了以下文章的的內容:
完整討論串 (本文為第 2 之 2 篇):
MacDev 近期熱門文章
PTT數位生活區 即時熱門文章