I think that AudioSession is not used on OS X.
The sample code you are working from is likely for iOS.
If you check the documentation for AudioSession, you will see:
These functions apply only to iOS. They do not apply to Mac OS X.
Additionally, see this discussion. AudioSession is simply not available, which is why you get EntryPointNotFoundException when trying to call it...