Hi, I'm trying to download an audio file with curl and then send the data to an audioshield. When use something tiny like a 2-second ogg file, it works as expected. But when the files is of any significant length, it seems to hang at process.run()
Here's the relevant bit of code:
Process p;
Serial.println("begin");
p.begin("curl");
Serial.println("addParameters");
p.addParameter("--insecure"); // the Yun doesn't recognize the CA on IBM's ssl cert, it exits with CURLE_SSL_CACERT (60)
p.addParameter("--user");
p.addParameter(TTS_USERNAME + ":" + TTS_PASSWORD);
p.addParameter("-H");
p.addParameter("Accept: audio/wav"); // or audio/ogg; codec=opus, but the vs1053b can't decode opus (yet)
p.addParameter("https://stream.watsonplatform.net/text-to-speech-beta/api/v1/synthesize?text=Hello%20world");
Serial.println("run");
p.run(); // Run the process and wait for its termination
Serial.println("setting up music player");
//...
If I switch it to ogg, then the file is only ~19kb and it gets sent to the mp3 shield (which apparently can't play ogg/opus at the moment). But if I switch it to wav format, then the file is ~200kb and my "setting up music player" line never gets logged.
Any ideas? Would the asynchronous version make a difference here?