AVAudioPlayer Output to Speaker
After searching around for how to send AVAudioPlayer
output to the iPhone's speaker, I found this:
iPhone audio 开发者_开发知识库playback: force through internal speaker?
Despite setting the category correctly to AVAudioSessionCategoryPlayAndRecord
, this solution doesn't seem to be working for me and won't even let the build compile, giving me this error:
"_AudioSessionSetProperty", referenced from:
...
...
ld: symbol(s) not found
collect2: ld returned 1 exit status
Am I not including something? I'm importing AudioToolbox
, AVFoundation
, and CoreAudio
.
My class implements AVAudioSessionDelegate
, AVAudioRecorderDelegate
, AVAudioPlayerDelegate
, and UITextFieldDelegate
.
Any help would be greatly appreciated!
Add the AudioToolbox and AVFoundation frameworks to your project by Right-Cliking on Frameworks -> Add -> Existing Frameworks
精彩评论