Sending Cordova.Audio-files to Meteor Server

Reading an Audio-file on my Server

Hi everyone. I’m trying to work with IBM Watson’s Speech-To-Text in my Meteor app for iOS.

  1. Record audio using iOS device microphone and save to file
  2. Upload file to Watson for processing

So far I’ve used the Cordova Media-plugin to complete step 1, so far so good, but I’m banging my head against the wall trying to get the file uploaded to Watson. It seems Watson needs a ReadStream object created by fs.createReadStream.

I’ve tried accessing my recorded audio file on the Meteor server, but can’t access that part of the file system it seems. The file is located in cordova.file.tempDirectory aka. file:///private/var/mobile/Containers/Data/Application/2F2DB25F-FF81-46CD-AFE0-0DE78207961E/tmp/“. (failed)

anyone have any ideas on how I should proceed? It seems like such a simple thing I need, but I haven’t been able to find any solutions.