Record WAV file to use Wit AI?

If I had a microphone set up with my Spark. Would there be any way to pass a wav file to the Wit API to play with voice recognition?

https://wit.ai/

1 Like

Wowza… that’s a pretty impressive project to start…

You’ve gotta record sound, store it, encode it, store it again and send it off to a server over an HTTPS connection (not possible on the spark)

You might be better off having a server in between and having a TCP/UDP connection that your spark records and sends the bytes off to the server… the server would then compile the results and communicate with the Wit API…

I could be far off, someone else with lots more knowledge can help…

If you google anything dealing with recording audio and an arduino, they all rely on a daughter board (shield) with extra hardware to help collect, encode, and store the content as these micro controllers often don’t have enough memory.


It relies on an SD board to help and some buffering tricks…

Total inception moment (a post to another post to 3 other posts about it)

An example board which might be neat to play with:

love it!

i was trying to find one about the audio part too… i remember posting 3 links to someone about that too, but cant see it… here are a couple more to read


You can play AND record WAVE files with an normal arduino 328 without any extra
shields. Just connect an SD-Card with some bread board cables and you are there.

The lib TMRpcm did the complete job.

The funny part is, that you can connect the speaker direct to a digital pin 9 and
you can hear the “sound” without any amplifier.

Did the TMRpcm lib run on the spark Core as well?

Greetings

Andreas

TMRpcm does not run on Spark Core. Been trying to stand it up this morning.

What I’m trying to do is stream the audio over TCP (maybe UDP if it will be faster) to be communicating to a RaspPi. Then save the streaming file on the RaspPi.

I’ve used the https://github.com/spark/local-communication-example to stand up communication on both ends and can send the analogRead values to the RaspPi with pretty low latency.

What I am trying to do now is understand what I have to do with that data (or even if it is the right data to do something with). How can I take this data and save it on the RaspPi to, say a WAV file that can, when recording has been told to stop, be played back and used?

1 Like