March 4, 2019
I am trying to develop IoT based Audio Analytics using ThingSpeak cloud
I am planing to capture Audio using MIC from PC /Matlab or using other device like RaspberryPi
Anybody can help me on how to stream Audio data from Mic to ThinkSpeak cloud , can I use MQTT or other REST API Like HTTP with WebSockets ?
If then, Then how ? Any example ? It would be best to do so in real time as well.
Even if I bring , then how to save audio in .wav file ? How to send wave file to user to their mobile?
March 7, 2017
ThingSpeak is finely tuned for uploading low sample rate data. However, it is possible to use the full capability of ThingSpeak to send and playback audio data. We have succeeded in sending compressed audio files by using the full 255 characters in each field and also the location and status fields. You will then need to decode the data on the receive side. Since you have access to MATLAB, the many steps of encoding and decoding can be completed fairly easily, but sending so much data will consume messages on ThingSpeak. A paid license will greatly increase the potential through put.
Please consider sharing your encoding and decoding scripts on File Exchange if you are able to get it working.
March 4, 2019
Thanks for your reply .
I can down Sample to reduce the the size , I need to send minimum of minimum duration 1 minute.
Let's say , my sample rate is kHz , then 4000 samples ( 16 bit size each sample ) per second ,so , in 60 second 24000 samples in total
I am new in ThinkSpeak , I have these questions
1) This means , character buffer size is 255 bytes , i.e , 256 samples in each buffer that I can send each time from my sensor node /PC
How do I insert such buffer of 255 characters in channel filed and send using ThinkSpeak RESTfull API ? Any example ?
2) I believe I have to loop this request 24000/256 = 94 times , right ? How do I do this looping ?
3) Do I need to wait for response for sending next chunk in the loop ?
4) Similarly , how I do retrieve these chunks of 256 samples buffer in ThinkSpeak cloud and combine to get this 1 minute duration Finally , Any example ?
March 7, 2017
I would strongly recommend going through the Getting Started tutorial to orient yourself with ThingSpeak processes. Its pretty quick, and covers a lot of our features.
Regarding your questions:
1. There are several ways to write date to ThingSpeak, covered here: https://www.mathworks.com/help/thingspeak/write-data.html
Specifically the REST API for writing data (with lots of examples) is here:
I am not sure how fast you will want to ingest your data. You may be able to get higher throughput with a bulk write, which allows you to write multiple entries with one POST>
if your samples were 1 byte each, you can save 2805 in a single entry (8 fields,status and lat/long). You also may be able to use compression to do better.
You could use approximately 9 entries to upload 1 minute of your data.
2. The rate limit will make looping difficult in a single MATLAB script. You can write a single script and then use the TimeControl app to call the script at regular intervals.
https://www.mathworks.com/help/thingspeak/timecontrol-app.html AS I described above, you may be able to use the bulk write feature to complete the task in fewer repetitions.
3. Yes you will need to wait before writing additional data, up to 15 seconds for a free account. The rate limits are described in the how to buy page:
4. Here are the ways to read data from a channel:
Four your case, since you probably want to analyze the data with MATLAB, I would use a MATLAB analysis to read the data, starting with thingSpeakRead.
Then you can process the data in the script, and possibly re write the data to another channel.
Here is an example showing how to read data from a channel, process it, and the write it back to another channel:
Most Users Ever Online: 166
Currently Browsing this Page:
Guest Posters: 1
Newest Members:Advantagetreeexperts, laundrydaddyuk, techhhelp5, ken, tran, huldacormier
Moderators: cstapels: 460
Administrators: Hans: 405, lee: 457