I’m working on an Expo app that will submit short audio clips to Amazon Lex for speech-to-text processing. I’ve read other topics + questions, and think what I’m experiencing seems new.
const uri = this.recording.getURI();
const response = await fetch(uri);
const blob = await response.blob();
I’m using this code to construct a blob from my local file, and then sending to lex with “blob” as the inputStream parameter. It works in the simulator, but not on an actual ios device. On both devices, the contents of “blob” look the same when I log them to the screen.
{“_data”:{“size”:48792,“blobId”:“077A…”,“type”:“application/octet-stream”,“offset”:0,“name”:“recording-E8ECDDD…E7F.caf”}}
But while it works in the simulator, on my real iPhone X I get an error back from Lex complaining that “Expected params.inputStream to be a string, Buffer, Stream, Blob, or typed array object”.
Anyone have any suggestions? I can’t find anything else in the Expo FileSystem library that looks like it would help with uploading or file conversion.