Re: Use WKSessionFile as Data for AVAudioPlayer?

2017-02-08 Thread Eric Dolecki
Ignore that comment. If love to know how to use the actual file though.  Get Outlook for iOS On Wed, Feb 8, 2017 at 12:35 PM -0500, "Jens Alfke" wrote: On Feb 8, 2017, at 5:48 AM, Eric E. Dolecki wrote:                 try self.player =

Re: Use WKSessionFile as Data for AVAudioPlayer?

2017-02-08 Thread Jens Alfke
> On Feb 8, 2017, at 5:48 AM, Eric E. Dolecki wrote: > > try self.player = AVAudioPlayer(contentsOf: file.fileURL!) Why are you trying to load it into memory? You want to avoid that if possible with media data. Just initialize AVAudioPlayer with the URL

Re: Use WKSessionFile as Data for AVAudioPlayer?

2017-02-08 Thread Eric E. Dolecki
UPDATE. Fixed. I bagged on sendFile and instead I am using sendMessage. The problem with that is the iOS app needs to be open, but it plays the message for me. *Watch:* let data = NSData(contentsOf: saveURL as! URL) sendAudioFile(file: data!) *iOS:* func session(_ session: WCSession,

Re: Use WKSessionFile as Data for AVAudioPlayer?

2017-02-08 Thread Eric E. Dolecki
When I try the following I get a "OSStatus error 2003334207" func session(_ session: WCSession, didReceive file: WCSessionFile) { DispatchQueue.main.async { self.versionLabel.text = "We got a real audio file." self.versionLabel.textColor = UIColor.blue

Re: Use WKSessionFile as Data for AVAudioPlayer?

2017-02-07 Thread Jens Alfke
> On Feb 7, 2017, at 6:49 PM, Eric E. Dolecki wrote: > > Now, I want to instantiate an AVAudioPlayer and play that sent file. I know > that it's received (didFinish file transfer fires in the Watch Extension). > How do I do that? I don't know how to make that file Data.

Use WKSessionFile as Data for AVAudioPlayer?

2017-02-07 Thread Eric E. Dolecki
I am transferring an audio file from Apple Watch extension to iOS application. In the Extension: func sendAudioFileProper(){ WCSession.default().transferFile(saveURL as! URL, metadata: nil) } I create saveURL like this: let fileManager = FileManager.default let container =