I am trying to use AVAudioSession in Xcode for my Mac OS application, but Xcode when I try using this code:
import Foundation
import AVFoundation
var recordingSession: AVAudioSession!
Xcode gives me a error: "Use of undeclared type 'AVAudioSession'"
I have correctly linked the AVFoundation framework to my project, but it still gives that error.
Upon looking into the current AVFoundation framework, I found that AVAudioSession header does not exist inside of AVFoundation. I have looked all over Google and have found no evidence of anybody else having this issue, and Apple has not deprecated AVAudioSession.
Is AVAudioSession residing in some other framework?
It looks like AVAudioSession is only available on iOS. Here is the AVFoundation programming guide for Mac:
https://developer.apple.com/library/mac/documentation/AudioVideo/Conceptual/AVFoundationPG/Articles/00_Introduction.html#//apple_ref/doc/uid/TP40010188
...and the AVFoundation API for Mac:
https://developer.apple.com/library/mac/navigation/index.html?filter=avfoundation#section=Resource%20Types&topic=Reference
Example from Apple on how to record audio (and video):
https://developer.apple.com/library/mac/samplecode/AVRecorder/Introduction/Intro.html#//apple_ref/doc/uid/DTS40011004
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With