# Passing voice data to Processing

**URL:** <https://discourse.processing.org/t/passing-voice-data-to-processing/24640>\
**Category:** Libraries\
**Created:** [October 16, 2020, 10:40am UTC](https://discourse.processing.org/t/passing-voice-data-to-processing/24640 "2020-10-16T10:40:42Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![humus](https://avatars.discourse-cdn.com/v4/letter/h/e36b37/32.png) [@humus](https://discourse.processing.org/u/humus)\
**Post date:** [October 16, 2020, 10:40am UTC](https://discourse.processing.org/t/passing-voice-data-to-processing/24640/1 "2020-10-16T10:40:43Z")

</div>

Hi,

I am a beginner in using Processing. I would like to make a project where voice commands (given at a real time) by the microphone of the notebook/tablet/smartphone are passed to Processing to display events linked with specific words (e.g. if one says “Milk” on the microphone, Processing shows on the display window an image of a milk bottle saved in the data folder of the project): is it possible? How?  
Thanks  
Best regards  
Humus

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 16, 2020, 10:51am UTC](https://discourse.processing.org/t/passing-voice-data-to-processing/24640/2 "2020-10-16T10:51:02Z")

</div>

Hi @humus welcome to the forum.  
I don’t think it is easy for a beginner, but it is possible. You will need the Google speech recognizer.  
[Here](https://github.com/EmmanuelPil/Android-java-code-utilities-widgets-for-Processing-for-Android/blob/master/Speech%20recognition) is a code for an Android device that can capture words.

---

<div class="post-metadata">

**Author:** ![humus](https://avatars.discourse-cdn.com/v4/letter/h/e36b37/32.png) [@humus](https://discourse.processing.org/u/humus)\
**Post date:** [October 19, 2020, 11:56am UTC](https://discourse.processing.org/t/passing-voice-data-to-processing/24640/3 "2020-10-19T11:56:22Z")

</div>

Thanks Noel,

but how to build the entire code? I tried to visit the link you have indicated but I can’t undrstand…thanks

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 19, 2020, 4:11pm UTC](https://discourse.processing.org/t/passing-voice-data-to-processing/24640/4 "2020-10-19T16:11:20Z")

</div>

But did you run the code?  
Did it work?

---

<div class="post-metadata">

**Author:** ![humus](https://avatars.discourse-cdn.com/v4/letter/h/e36b37/32.png) [@humus](https://discourse.processing.org/u/humus)\
**Post date:** [October 19, 2020, 9:40pm UTC](https://discourse.processing.org/t/passing-voice-data-to-processing/24640/5 "2020-10-19T21:40:08Z")

</div>

no because it needs libraries that I don’t find…

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 19, 2020, 9:42pm UTC](https://discourse.processing.org/t/passing-voice-data-to-processing/24640/6 "2020-10-19T21:42:43Z")

</div>

These are native libraries already existent on the device. Just run the code. What Android version are you using.

---

<div class="post-metadata">

**Author:** ![humus](https://avatars.discourse-cdn.com/v4/letter/h/e36b37/32.png) [@humus](https://discourse.processing.org/u/humus)\
**Post date:** [October 19, 2020, 10:00pm UTC](https://discourse.processing.org/t/passing-voice-data-to-processing/24640/7 "2020-10-19T22:00:08Z")

</div>

but I have to run it on an Android device? How to run Processing on an Android device? Thanks

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 19, 2020, 10:04pm UTC](https://discourse.processing.org/t/passing-voice-data-to-processing/24640/8 "2020-10-19T22:04:40Z")

</div>

Download the app APDE, on the Play Store. You speak the words into your device’s microphone, and use the OscP5 library to transmit over wifi to the sketch on your PC which can display the images.

---

<div class="post-metadata">

**Author:** ![humus](https://avatars.discourse-cdn.com/v4/letter/h/e36b37/32.png) [@humus](https://discourse.processing.org/u/humus)\
**Post date:** [October 20, 2020, 4:33pm UTC](https://discourse.processing.org/t/passing-voice-data-to-processing/24640/9 "2020-10-20T16:33:30Z")

</div>

Where I have to install OscP5 library? On Android device or pc Processing version?

Also, how to set Wi-Fi to pass all to the pc? Do I need a separated router?

thanks

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 20, 2020, 5:31pm UTC](https://discourse.processing.org/t/passing-voice-data-to-processing/24640/10 "2020-10-20T17:31:19Z")

</div>

> [@humus](#):
>
> Where I have to install OscP5 library

On both. [Here](https://discourse.processing.org/t/oscp5-for-the-apde/18402) you can download the android version and a sample sketch for communication between phone and PC. The lib for PC you can install from the IDE.  
It’s supposed to work on your home network provider. You do use one, isn’t it?

---

<div class="post-metadata">

**Author:** ![humus](https://avatars.discourse-cdn.com/v4/letter/h/e36b37/32.png) [@humus](https://discourse.processing.org/u/humus)\
**Post date:** [October 22, 2020, 6:36am UTC](https://discourse.processing.org/t/passing-voice-data-to-processing/24640/11 "2020-10-22T06:36:09Z")

</div>

It doesn’t work. I will try again with a dedicated router, probably that is the problem.

The thing that I would like to realize, in alternative, should be:

1. register a voice recording;
2. taking from that recording the table of amplitudes instant per instant (e.g. at time 00"0032 the amplitude is 0.0654 (on a normalised scale);
3. associate that amplitude to a colour pixel (e.g. 200, 100,50 in RGB );
4. show on the display the video that links colours pixels (or group of pixels) to every instant.

This should be the basic from which to start an animation (e.g. linking pixels with same colour by a line). It should be interesting to realize a 3D video in order to export the final result on the video as a solid 3D (or a 2D image too).

Thanks  
Best regards  
Humus

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 22, 2020, 9:33am UTC](https://discourse.processing.org/t/passing-voice-data-to-processing/24640/12 "2020-10-22T09:33:24Z")

</div>

> [@humus](#):
>
> taking from that recording the table of amplitudes instant per instant

Do you mean frequency or amplitude recognition?  
Here’s a video:

[![](https://img.youtube.com/vi/2O3nm0Nvbi4/hqdefault.jpg "17.11: Sound Visualization: Frequency Analysis with FFT - p5.js Sound Tutorial") ](https://www.youtube.com/watch?v=2O3nm0Nvbi4)

I’ve used OK google before to switch on lamps etc. I used my phone with voice recognition and an Arduino over Bluetooth. The hot word “Ok Google” is important for not having your hands on the phone all the time.  
But indeed you need a router because a telephone company data connection would be too costly.  
You can however use a hot word on PC as well with this Google browser extension.  
[https://chrome.google.com/webstore/detail/voice-in-voice-typing/pjnefijmagpdjfhhkpljicbbpicelgko?hl=pt-BR](https://chrome.google.com/webstore/detail/voice-in-voice-typing/pjnefijmagpdjfhhkpljicbbpicelgko?hl=pt-BR)  
And here is another video about voice recognition:

[![](https://img.youtube.com/vi/q_bXBcmfTJM/maxresdefault.jpg "10.4: Speech Recognition with p5.Speech - Programming with Text") ](https://www.youtube.com/watch?v=q_bXBcmfTJM)

Once you have the phrase in the String you just filter it with the string class functions to pick out the words that trigger the action you want.  
[https://docs.oracle.com/javase/8/docs/api/java/lang/String.html](https://docs.oracle.com/javase/8/docs/api/java/lang/String.html)

---

<div class="post-metadata">

**Author:** ![humus](https://avatars.discourse-cdn.com/v4/letter/h/e36b37/32.png) [@humus](https://discourse.processing.org/u/humus)\
**Post date:** [October 24, 2020, 4:26pm UTC](https://discourse.processing.org/t/passing-voice-data-to-processing/24640/13 "2020-10-24T16:26:15Z")

</div>

Hi Noel, thanks for your reply. I have just taken a look on the links you attached and in the code there are strings like “let” or “function” that the processing version I have downloaded and installed on my PC does not recognize: why?

Thanks  
Humus

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 24, 2020, 4:41pm UTC](https://discourse.processing.org/t/passing-voice-data-to-processing/24640/14 "2020-10-24T16:41:03Z")

</div>

> [@humus](#):
>
> does not recognize: why?

Oh, because that’s The P5.js version of processing.  
You’ll have to study the translation.  
For example function() will be void().  
The variables you have to define, because ‘let’ can be any type of variable or object.  
In that respect, P5.js it is easier.

> **[Processing transition](https://github.com/processing/p5.js/wiki/Processing-transition)**
>
> p5.js is a client-side JS platform that empowers artists, designers, students, and anyone to learn to code and express themselves creatively on the web. It is based on the core principles of Proces...

---

<div class="post-metadata">

**Author:** ![humus](https://avatars.discourse-cdn.com/v4/letter/h/e36b37/32.png) [@humus](https://discourse.processing.org/u/humus)\
**Post date:** [October 24, 2020, 4:44pm UTC](https://discourse.processing.org/t/passing-voice-data-to-processing/24640/15 "2020-10-24T16:44:29Z")

</div>

Which is the difference between Processsing and P5.js ? Is there any translation manual? How to import a P5.js code in Processing? thanks

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 24, 2020, 4:44pm UTC](https://discourse.processing.org/t/passing-voice-data-to-processing/24640/16 "2020-10-24T16:44:51Z")

</div>

> **[processing/p5.js](https://github.com/processing/p5.js/wiki/Processing-transition)**
>
> p5.js is a client-side JS platform that empowers artists, designers, students, and anyone to learn to code and express themselves creatively on the web. It is based on the core principles of Proces...

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 24, 2020, 4:48pm UTC](https://discourse.processing.org/t/passing-voice-data-to-processing/24640/17 "2020-10-24T16:48:12Z")

</div>

> [@humus](#):
>
> Is there any translation manual?

[http://faculty.purchase.edu/joseph.mckay/p5jsconverter.html](http://faculty.purchase.edu/joseph.mckay/p5jsconverter.html)

---

<div class="post-metadata">

**Author:** ![humus](https://avatars.discourse-cdn.com/v4/letter/h/e36b37/32.png) [@humus](https://discourse.processing.org/u/humus)\
**Post date:** [October 24, 2020, 4:49pm UTC](https://discourse.processing.org/t/passing-voice-data-to-processing/24640/18 "2020-10-24T16:49:36Z")

</div>

Thanks! And from P5.js to Processing?

---

<div class="post-metadata">

**Author:** ![noel](https://yyz2.discourse-cdn.com/flex036/user_avatar/discourse.processing.org/noel/32/213_2.png) [@noel](https://discourse.processing.org/u/noel)\
**Post date:** [October 24, 2020, 4:58pm UTC](https://discourse.processing.org/t/passing-voice-data-to-processing/24640/19 "2020-10-24T16:58:20Z")

</div>

Not aware of a translator, but I would watch this video, including the second part.

[![](https://img.youtube.com/vi/AmlAiKsiy0o/maxresdefault.jpg "Q&A #7.1: Comparing p5.js and Processing - Part 1") ](https://www.youtube.com/watch?v=AmlAiKsiy0o)

---

<div class="post-metadata">

**Author:** ![humus](https://avatars.discourse-cdn.com/v4/letter/h/e36b37/32.png) [@humus](https://discourse.processing.org/u/humus)\
**Post date:** [October 24, 2020, 4:59pm UTC](https://discourse.processing.org/t/passing-voice-data-to-processing/24640/20 "2020-10-24T16:59:57Z")

</div>

thanks! The P5.js code is played in Processing? If not, how to play it and by what? Thanks

[Next page](https://discourse.processing.org/t/passing-voice-data-to-processing/24640.md?page=2)
