Mute Voice Directions in Here Maps iOS SDK

2019-07-31 18:43发布

I want to toggle the voice directions in my iOS app between on and off. The HERE maps instructions (https://developer.here.com/mobile-sdks/documentation/ios-hybrid-plus/topics_api_nlp_hybrid_plus/protocolnmaaudiomanagerdelegate-p.html) are still all in objective-C. It is quite clear in that language how to do this, but I am looking for the Swift 3 equivalent. That manual says:

  • @optional (BOOL) audioManager:( NMAAudioManager *) audioManager shouldPlayOutput:( NMAAudioOutput *) output

Called when the audio manager has output to play.

If the delegate returns YES, or the delegate does not implement this method, the output is played immediately. If the delegate returns NO, the delegate takes over responsiblity for handling the output.

I am guessing something similar to this, but I can't get it right:

func audioManagerShouldPlayOutput(_ audioManager: NMAAudioManager!, shouldPlayOutput:false) {
    }

1条回答
聊天终结者
2楼-- · 2019-07-31 19:35

This is the signature created using the XCode "Generated Interface" assistant editor, hopefully it is helpful! Looks like you are off just a little bit.

optional public func audioManager(_ audioManager: NMAAudioManager!, shouldPlay output: NMAAudioOutput!) -> Bool
查看更多
登录 后发表回答