<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Dilek Karasoy</title>
    <description>The latest articles on DEV Community by Dilek Karasoy (@dilek).</description>
    <link>https://dev.to/dilek</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F873456%2Fb4a48728-c252-4618-b77c-0e08a4a77a05.jpeg</url>
      <title>DEV Community: Dilek Karasoy</title>
      <link>https://dev.to/dilek</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/dilek"/>
    <language>en</language>
    <item>
      <title>Build your own Krisp App: Noise Cancellation with Python</title>
      <dc:creator>Dilek Karasoy</dc:creator>
      <pubDate>Wed, 16 Aug 2023 18:43:45 +0000</pubDate>
      <link>https://dev.to/picovoice/build-your-own-krisp-app-noise-cancellation-with-python-34fi</link>
      <guid>https://dev.to/picovoice/build-your-own-krisp-app-noise-cancellation-with-python-34fi</guid>
      <description>&lt;p&gt;Krisp has become popular with COVID-19. Removing background noises improves the quality of virtual meetings. It's easy to download the Krisp app and start using. How about building one?&lt;/p&gt;

&lt;p&gt;Enter [Koala Noise Suppression (&lt;a href="https://picovoice.ai/platform/koala/"&gt;https://picovoice.ai/platform/koala/&lt;/a&gt;)&lt;br&gt;
It takes only a few lines of Python to get it embedded into your app. &lt;a href="https://picovoice.ai/docs/quick-start/koala-python/"&gt;Koala Noise Suppression Python SDK&lt;/a&gt; supports Linux, macOS, Windows, Raspberry Pi, and NVIDIA Jetson. [Koala Noise Suppression (&lt;a href="https://picovoice.ai/platform/koala/"&gt;https://picovoice.ai/platform/koala/&lt;/a&gt;) can also run on mobile and web!&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install the SDK
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install pvkoala
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Import the package
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pvkoala
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create an instance with your &lt;code&gt;AccessKey&lt;/code&gt;:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;handle = pvkoala.create(access_key)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Get your &lt;code&gt;AccessKey&lt;/code&gt; from &lt;a href="https://console.picovoice.ai/"&gt;Picovoice Console&lt;/a&gt; for free and replace the placeholder with it!&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Suppress Noise!
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;enhanced_pcm = handle.process(pcm)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Voila! You're done!&lt;/p&gt;




&lt;p&gt;Additional Resources:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://github.com/Picovoice/koala/tree/main/demo/python"&gt;Open-source demo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Other Koala &lt;a href="https://picovoice.ai/docs/koala/"&gt;Noise Suppression SDKs&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;More about &lt;a href="https://picovoice.ai/company/"&gt;Picovoice&lt;/a&gt;
&lt;/li&gt;
&lt;/ol&gt;

</description>
      <category>python</category>
      <category>machinelearning</category>
      <category>programming</category>
      <category>productivity</category>
    </item>
    <item>
      <title>Speaker Identification for Streaming with Python</title>
      <dc:creator>Dilek Karasoy</dc:creator>
      <pubDate>Fri, 11 Aug 2023 18:52:12 +0000</pubDate>
      <link>https://dev.to/picovoice/speaker-identification-for-streaming-with-python-c8n</link>
      <guid>https://dev.to/picovoice/speaker-identification-for-streaming-with-python-c8n</guid>
      <description>&lt;p&gt;Open-source speaker recognition is the only option for developers, unless they work for large enterprises. Recently, at Picovoice we made our &lt;a href="https://picovoice.ai/blog/speaker-recognition-for-developers/"&gt;internal tool for Speaker Recognition public&lt;/a&gt;. So, those who prefer production-ready solutions now have an option! &lt;/p&gt;

&lt;p&gt;Let's get started!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Install [Picovoice Eagle Speaker Recognition]&lt;/strong&gt;(&lt;a href="https://picovoice.ai/platform/eagle/"&gt;https://picovoice.ai/platform/eagle/&lt;/a&gt;) using &lt;code&gt;pip&lt;/code&gt;. We will be using &lt;a href="https://picovoice.ai/company/#tools"&gt;pvrecorder&lt;/a&gt;  to get cross-platform audio, so install that as well:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip3 install pveagle pvrecorder
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Grab your &lt;code&gt;AccessKey&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
If you haven't create an account on &lt;a href="https://console.picovoice.ai/"&gt;Picovoice Console&lt;/a&gt; for free and grab your &lt;code&gt;AccessKey&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Enroll Speakers&lt;/strong&gt;&lt;br&gt;
Import &lt;code&gt;pveagle&lt;/code&gt; and create an instance of the &lt;code&gt;EagleProfiler&lt;/code&gt; class:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pveagle

access_key = "{YOUR_ACCESS_KEY}";
try:
    eagle_profiler = pveagle.create_profiler(access_key=access_key)
except pveagle.EagleError as e:
    # Handle error
    pass
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Don't forget to replace the placeholder with your &lt;code&gt;AccessKey&lt;/code&gt;!&lt;/p&gt;

&lt;p&gt;Now, import &lt;code&gt;pvrecorder&lt;/code&gt; and create an instance of the recorder as well. Use the &lt;code&gt;EagleProfiler&lt;/code&gt;'s &lt;code&gt;.min_enroll_samples&lt;/code&gt; as the &lt;code&gt;frame_length&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from pvrecorder import PvRecorder

DEFAULT_DEVICE_INDEX = -1
recorder = PvRecorder(
    device_index=DEFAULT_DEVICE_INDEX,
    frame_length=eagle_profiler.min_enroll_samples)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The &lt;code&gt;.enroll()&lt;/code&gt; function generates a percentage value to know when Enrollment is done and another speaker can be enrolled:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;recorder.start()

enroll_percentage = 0.0
while enroll_percentage &amp;lt; 100.0:
    audio_frame = recorder.read()
    enroll_percentage, feedback = eagle_profiler.enroll(audio_frame)

recorder.stop()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. Export the &lt;code&gt;Speaker Profile&lt;/code&gt;&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;We'll need use in the next step to identify / verify the speaker!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;speaker_profile = eagle_profiler.export()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;You can reuse the &lt;code&gt;speaker_profile&lt;/code&gt; object. Check out the &lt;a href="https://picovoice.ai/docs/api/eagle-python/"&gt;docs&lt;/a&gt; for details. &lt;/p&gt;

&lt;p&gt;Add more speakers by creating additional profiles by calling the &lt;code&gt;.reset()&lt;/code&gt; function on the &lt;code&gt;EagleProfiler&lt;/code&gt;, and repeating the &lt;code&gt;.enroll()&lt;/code&gt; step.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Clean up used resources:&lt;/strong&gt;&lt;br&gt;
Once you create profiles for all speakers, let's clean up used resources!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;recorder.delete()
eagle_profiler.delete()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;6. Recognize Speakers:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;import pveagle&lt;/p&gt;

&lt;p&gt;access_key = "{YOUR_ACCESS_KEY}"&lt;br&gt;
profiles = [speaker_profile_1, speaker_profile_2]&lt;br&gt;
try:&lt;br&gt;
    eagle = pveagle.create_recognizer(&lt;br&gt;
        access_key=access_key,&lt;br&gt;
        speaker_pofiles=profiles)&lt;br&gt;
except pveagle.EagleError as e:&lt;br&gt;
    # Handle error&lt;br&gt;
    pass&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Set up `pvrecorder` to use with Eagle Speaker Recognition:

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;recorder = PvRecorder(&lt;br&gt;
    device_index=DEFAULT_DEVICE_INDEX,&lt;br&gt;
    frame_length=eagle.frame_length)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;Pass audio frames into the `eagle.process()` function get back speaker scores:

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;while True:&lt;br&gt;
    audio_frame = recorder.read()&lt;br&gt;
    scores = eagle.process(audio_frame)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;When finished, again clean up used resources:


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;eagle.delete()&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


## Connect them All Together

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;import pveagle&lt;br&gt;
from pvrecorder import PvRecorder&lt;/p&gt;

&lt;p&gt;DEFAULT_DEVICE_INDEX = -1&lt;br&gt;
access_key = "{YOUR_ACCESS_KEY}";&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 1: Enrollment
&lt;/h1&gt;

&lt;p&gt;try:&lt;br&gt;
    eagle_profiler = pveagle.create_profiler(access_key=access_key)&lt;br&gt;
except pveagle.EagleError as e:&lt;br&gt;
    pass&lt;/p&gt;

&lt;p&gt;enroll_recorder = PvRecorder(&lt;br&gt;
    device_index=DEFAULT_DEVICE_INDEX,&lt;br&gt;
    frame_length=eagle_profiler.min_enroll_samples)&lt;/p&gt;

&lt;p&gt;enroll_recorder.start()&lt;/p&gt;

&lt;p&gt;enroll_percentage = 0.0&lt;br&gt;
while enroll_percentage &amp;lt; 100.0:&lt;br&gt;
    audio_frame = enroll_recorder.read()&lt;br&gt;
    enroll_percentage, feedback = eagle_profiler.enroll(audio_frame)&lt;/p&gt;

&lt;p&gt;enroll_recorder.stop()&lt;/p&gt;

&lt;p&gt;speaker_profile = eagle_profiler.export()&lt;/p&gt;

&lt;p&gt;enroll_recorder.delete()&lt;br&gt;
eagle_profiler.delete()&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 2: Recognition
&lt;/h1&gt;

&lt;p&gt;try:&lt;br&gt;
    eagle = pveagle.create_recognizer(&lt;br&gt;
        access_key=access_key,&lt;br&gt;
        speaker_pofiles=[speaker_profile])&lt;br&gt;
except pveagle.EagleError as e:&lt;br&gt;
    pass&lt;/p&gt;

&lt;p&gt;recognizer_recorder = PvRecorder(&lt;br&gt;
    device_index=DEFAULT_DEVICE_INDEX,&lt;br&gt;
    frame_length=eagle.frame_length)&lt;/p&gt;

&lt;p&gt;recognizer_recorder.start()&lt;/p&gt;

&lt;p&gt;while True:&lt;br&gt;
    audio_frame = recorder.read()&lt;br&gt;
    scores = eagle.process(audio_frame)&lt;br&gt;
    print(scores)&lt;/p&gt;

&lt;p&gt;recognizer_recorder.stop()&lt;/p&gt;

&lt;p&gt;recognizer_recorder.delete()&lt;br&gt;
eagle.delete()&lt;/p&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;


---
For more information:

- [Check the original article],(https://picovoice.ai/blog/speaker-recognition-in-python/)
- Learn more about Speaker [Recognition](https://picovoice.ai/blog/speaker-recognition/), [Identification](https://picovoice.ai/blog/speaker-identification/) and [Verification](https://picovoice.ai/blog/voice-biometrics/),
- [Check out other Eagle Speaker Recognition SDKs](https://picovoice.ai/docs/eagle/)
- Visit [Eagle Speaker Recognition GitHub repository](https://github.com/Picovoice/eagle) for open-source demos and to create issues. While on GitHub, if you like building with Eagle Speaker Recognition, give it a star and help fellow devs find it easily.
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>machinelearning</category>
      <category>programming</category>
      <category>python</category>
      <category>challenge</category>
    </item>
    <item>
      <title>Live Audio Transcription with Python For Free</title>
      <dc:creator>Dilek Karasoy</dc:creator>
      <pubDate>Thu, 10 Aug 2023 15:07:57 +0000</pubDate>
      <link>https://dev.to/picovoice/live-audio-transcription-with-python-for-free-jff</link>
      <guid>https://dev.to/picovoice/live-audio-transcription-with-python-for-free-jff</guid>
      <description>&lt;p&gt;Unlike cloud speech-to-text APIs, &lt;a href="https://picovoice.ai/platform/cheetah/"&gt;Cheetah Streaming Speech-to-Text&lt;/a&gt; processes speech data locally on-device. Thus, it has a default advantage over the cloud speech-to-text APIs when it comes to speed. No cloud speech-to-text API can eliminate the network &lt;a href="https://picovoice.ai/blog/latency-in-speech-recognition/"&gt;latency&lt;/a&gt;. They can be fast, but to a certain degree. &lt;/p&gt;

&lt;p&gt;Let's learn to convert live audio to text using Picovoice &lt;a href="https://picovoice.ai/docs/quick-start/cheetah-python/"&gt;Cheetah Streaming Speech-to-Text Python SDK&lt;/a&gt;, so you can see it yourself. &lt;/p&gt;




&lt;p&gt;&lt;strong&gt;1. Install &lt;a href="https://picovoice.ai/docs/quick-start/cheetah-python/"&gt;Cheetah Streaming Speech-to-Text Python SDK&lt;/a&gt;&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip install pvcheetah
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Grab your &lt;code&gt;AccessKey&lt;/code&gt; from **&lt;a href="https://console.picovoice.ai/"&gt;Picovoice Console&lt;/a&gt;&lt;/strong&gt;**&lt;br&gt;
If you do not have an existing Picovoice Console Account, create one in minutes. No credit card is required. You can enjoy the Forever-Free Plan, as the name suggests, forever!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Import &lt;a href="https://picovoice.ai/platform/cheetah/"&gt;Cheetah Streaming Speech-to-Text&lt;/a&gt; package:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import pvcheetah
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. Create an instance of the speech-to-text object with your &lt;code&gt;AccessKey&lt;/code&gt;:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;handle = pvcheetah.create(access_key)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Don't forget to replace the placeholder with your &lt;code&gt;AccessKey&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;5. Implement audio recording.&lt;/strong&gt; &lt;br&gt;
&lt;a href="https://picovoice.ai/platform/cheetah/"&gt;Cheetah Streaming Speech-to-Text&lt;/a&gt; processes audio whether it comes from a microphone or another program. &lt;/p&gt;

&lt;p&gt;For the following, we assume there is a function available to us that provides the next available audio chunk (frame) as below.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;def get_next_audio_frame():
    pass
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Convert live audio to text:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;while True:
    partial_transcript, is_endpoint = handle.process(get_next_audio_frame())
    if is_endpoint:
        final_transcript = handle.flush()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;That's it! In 5 simple steps, you can get live audio converted into text!&lt;/p&gt;




&lt;p&gt;For more information, you can check&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;a href="https://picovoice.ai/blog/real-time-transcription-in-python/"&gt;the original article&lt;/a&gt;,&lt;/li&gt;
&lt;li&gt;&lt;a href="https://picovoice.ai/blog/real-time-transcription-live-streaming/"&gt;how to evaluate live audio transcription engines&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://picovoice.ai/blog/on-prem-speech-to-text/"&gt;on-prem deployment options&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://picovoice.ai/blog/top-transcription-engines/"&gt;the comparison of popular speech-to-text engines&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://picovoice.ai/blog/local-speech-to-text-with-cloud-level-accuracy/"&gt;advantages of local speech-to-text&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

</description>
      <category>python</category>
      <category>machinelearning</category>
      <category>programming</category>
      <category>challenge</category>
    </item>
    <item>
      <title>Voice AI with Raspberry Pi - ReSpeaker</title>
      <dc:creator>Dilek Karasoy</dc:creator>
      <pubDate>Wed, 15 Mar 2023 02:53:48 +0000</pubDate>
      <link>https://dev.to/picovoice/voice-ai-with-raspberry-pi-respeaker-46n2</link>
      <guid>https://dev.to/picovoice/voice-ai-with-raspberry-pi-respeaker-46n2</guid>
      <description>&lt;p&gt;For day 44 we'll use &lt;a href="https://picovoice.ai/platform/porcupine/"&gt;Porcupine Wake Word&lt;/a&gt; and Seeed Studio ReSpeaker. &lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/GqxWHoQ560g"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Let's get started!&lt;br&gt;
&lt;strong&gt;1. Installation&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Follow the instructions on &lt;a href="https://wiki.seeedstudio.com/ReSpeaker_4_Mic_Array_for_Raspberry_Pi/"&gt;Seeed Studio&lt;/a&gt; to install and set up the microphone array.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;-Install the demo:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;sudo pip3 install ppnrespeakerdemo
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;a href="https://picovoice.ai/platform/porcupine/"&gt;Porcupine Wake Word&lt;/a&gt; requires a valid &lt;code&gt;AccessKey&lt;/code&gt; at initialization If you haven't already, grab your AccessKey from &lt;a href="https://console.picovoice.ai/"&gt;Picovoice Console&lt;/a&gt; for free. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;2. Usage&lt;/strong&gt;&lt;br&gt;
Below are the colors associated with supported wake words for this demo:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;#ffff33 Alexa&lt;/li&gt;
&lt;li&gt;#ff8000 Bumblebee&lt;/li&gt;
&lt;li&gt;#ffffff Computer&lt;/li&gt;
&lt;li&gt;#ff0000 Hey Google&lt;/li&gt;
&lt;li&gt;#800080 Hey Siri&lt;/li&gt;
&lt;li&gt;#ff3399 Jarvis&lt;/li&gt;
&lt;li&gt;#00ff00 Picovoice&lt;/li&gt;
&lt;li&gt;#0000ff Porcupine&lt;/li&gt;
&lt;li&gt;&lt;h1&gt;
  
  
  000000 Terminator
&lt;/h1&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run the demo. Do not forget to replace the placeholder with your &lt;code&gt;AccessKey&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;porcupine_respeaker_demo --access_key ${ACCESS_KEY}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Wait for the demo to initialize and print &lt;code&gt;[Listening]&lt;/code&gt; in the terminal. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Say &lt;code&gt;Picovoice&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
The demo outputs:&lt;br&gt;
detected &lt;code&gt;'Picovoice'&lt;/code&gt;&lt;br&gt;
The lights are now set to green. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Say &lt;code&gt;Alexa&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
The lights are set to yellow now. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Say &lt;code&gt;Terminator&lt;/code&gt;&lt;/strong&gt;&lt;br&gt;
The lights are now turned off.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;_Happy Pi Day! _&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>100daysofcode</category>
      <category>challenge</category>
      <category>raspberrypi</category>
      <category>ai</category>
    </item>
    <item>
      <title>No Alexa, No Google: Custom Hotword Detection Arduino</title>
      <dc:creator>Dilek Karasoy</dc:creator>
      <pubDate>Thu, 09 Mar 2023 22:04:21 +0000</pubDate>
      <link>https://dev.to/picovoice/no-alexa-no-google-custom-hotword-detection-arduino-4ofe</link>
      <guid>https://dev.to/picovoice/no-alexa-no-google-custom-hotword-detection-arduino-4ofe</guid>
      <description>&lt;p&gt;Are you interested in calling your Arduino board with its own name? All you need is:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Arduino IDE  (free)&lt;/li&gt;
&lt;li&gt;Arduino Nano 33 BLE &lt;/li&gt;
&lt;li&gt;Picovoice Console  Account (free)&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;1. Train a custom hotword&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Sign up for [Picovoice Console] for free (&lt;a href="https://console.picovoice.ai/"&gt;https://console.picovoice.ai/&lt;/a&gt;)&lt;/li&gt;
&lt;li&gt;Go to the &lt;a href="https://console.picovoice.ai/ppn"&gt;Porcupine Page&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Select the language for your model&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Type in the phrase, i.e. name you'd like to give and click on the &lt;code&gt;train&lt;/code&gt;.&lt;br&gt;
[PS: You can read &lt;a href="https://picovoice.ai/docs/tips/choosing-a-wake-word/"&gt;our tips&lt;/a&gt; for selecting a hotword.]&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Pick Arm Cortex-M as the platform and Arduino Nano 33 BLE as the board type.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Paste your board UUID.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Open Arduino IDE&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Download &lt;code&gt;Porcupine_EN&lt;/code&gt; library&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Run the &lt;code&gt;GetUUID&lt;/code&gt; example from &lt;code&gt;Porcupine_EN&lt;/code&gt;. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Check the Serial Monitor&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Copy the UUID and paste it on Picovoice Console.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Click on Download.&lt;br&gt;
Congrats! You trained your hotword!&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Embed the Hotword&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Open the file &lt;code&gt;pv_porcupine_params.h&lt;/code&gt; with a text editor. &lt;code&gt;The KEYWORD_ARRAY[]&lt;/code&gt; contains your newly-trained model!&lt;/li&gt;
&lt;li&gt;Run the &lt;code&gt;PorcupineExample&lt;/code&gt; from the &lt;code&gt;Porcupine_EN&lt;/code&gt; library.&lt;/li&gt;
&lt;li&gt;Replace KEYWORD_ARRAY in the params.h with yours.&lt;/li&gt;
&lt;li&gt;Copy your &lt;code&gt;AccessKey&lt;/code&gt; from &lt;a href="https://console.picovoice.ai/"&gt;Picovoice Console&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Add your AccessKey in PorcupineExample.ino. Don't forget to wrap it in &lt;code&gt;"&lt;/code&gt; and terminate the line with &lt;code&gt;;&lt;/code&gt;!&lt;/li&gt;
&lt;li&gt;Upload and run the example&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Voila!&lt;/p&gt;

&lt;p&gt;Looking for more examples?&lt;br&gt;
Check out &lt;a href="https://picovoice.ai/blog/arduino-voice-recognition-in-ten-minutes-or-less/"&gt;Picovoice Blog&lt;/a&gt;&lt;/p&gt;

</description>
      <category>100daysofcode</category>
      <category>challenge</category>
      <category>arduino</category>
      <category>ai</category>
    </item>
    <item>
      <title>End-to-End Speech Recognition with Python</title>
      <dc:creator>Dilek Karasoy</dc:creator>
      <pubDate>Wed, 08 Mar 2023 04:54:10 +0000</pubDate>
      <link>https://dev.to/picovoice/end-to-end-speech-recognition-with-python-1ide</link>
      <guid>https://dev.to/picovoice/end-to-end-speech-recognition-with-python-1ide</guid>
      <description>&lt;p&gt;Let's start with why you should use &lt;a href="https://picovoice.ai/docs/quick-start/picovoice-python/"&gt;Picovoice Python SDK&lt;/a&gt; when there are alternative libraries and in-depth tutorials on speech recognition with Python. &lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Private - processes voice data on the device&lt;/li&gt;
&lt;li&gt;Cross-platform — Linux, macOS, Windows, Raspberry Pi, …&lt;/li&gt;
&lt;li&gt;Real-time - zero latency&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;-I do not need to say accurate I guess. I haven't seen any vendor claiming mediocre accuracy 🙃 &lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/MCWij6lZyP4"&gt;
&lt;/iframe&gt;
&lt;br&gt;
Now, let's get started!&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1 — Install Picovoice&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pip3 install picovoice
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2 — Create a Picovoice Instant&lt;/strong&gt;&lt;br&gt;
Picovoice SDK consists of &lt;a href="https://picovoice.ai/platform/porcupine/"&gt;Porcupine Wake Word&lt;/a&gt;, enabling custom hotwords and &lt;a href="https://picovoice.ai/platform/rhino/"&gt;Rhino Speech-to-Intent&lt;/a&gt;, enabling custom voice commands. Jointly they enable hands-free experiences.&lt;br&gt;
&lt;code&gt;Porcupine, set an alarm for 1 hours and 13 seconds.&lt;/code&gt;&lt;br&gt;
Porcupine detects the hotword "Porcupine", then Rhino captures the user’s intent and provides intent and intent details as seen below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;{
    is_understood: true,
    intent: setAlarm,
    slots: {
        hours: 1,
        seconds: 13
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;To create a Picovoice instance we need  Porcupine and Rhino models, paths to the models and callbacks for hotword detection and inference completion. For the simplicity, we'll use pre-trained &lt;a href="https://github.com/Picovoice/porcupine/tree/master/resources/keyword_files"&gt;Porcupine&lt;/a&gt; and &lt;a href="https://github.com/Picovoice/rhino/tree/master/resources/contexts"&gt;Rhino&lt;/a&gt; models, however, you can train custom ones on the &lt;a href="https://console.picovoice.ai/"&gt;Picovoice Console:&lt;/a&gt; While exploring the Picovoice Console, grab your &lt;code&gt;AccessKey&lt;/code&gt;, too! &lt;code&gt;Signing up for Picovoice Console is free, no credit card required.&lt;/code&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from picovoice import Picovoice
keyword_path = ...  # path to Porcupine wake word file (.PPN)
def wake_word_callback():
    pass
context_path = ...  # path to Rhino context file (.RHN)
def inference_callback(inference):
    print(inference.is_understood)
    if inference.is_understood:
        print(inference.intent)
        for k, v in inference.slots.items():
            print(f"{k} : {v}")

pv = Picovoice(
    access_key=${YOUR_ACCESS_KEY}
    keyword_path=keyword_path(),
    wake_word_callback=wake_word_callback,
    context_path=context_path(),
    inference_callback=inference_callback)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not forget to replace &lt;code&gt;model path&lt;/code&gt; and &lt;code&gt;AccessKey&lt;/code&gt; placeholders.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3 — Process Audio with Picovoice&lt;/strong&gt;&lt;br&gt;
Pass frames of audio to the engine:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pv.process(audio_frame)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4 — Read audio from the Microphone&lt;/strong&gt;&lt;br&gt;
Install &lt;code&gt;[pvrecorder](https://pypi.org/project/pvrecorder/)&lt;/code&gt; and read the audio:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;from pvrecoder import PvRecoder
# `-1` is the default input audio device.
recorder = PvRecoder(device_index=-1)
recorder.start()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Read audio frames from the recorder and pass it to &lt;code&gt;.process&lt;/code&gt; method:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pcm = recorder.read()
pv.process(pcm)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;5— Create a GUI with Tkinter&lt;/strong&gt;&lt;br&gt;
Tkinter is the standard GUI framework shipped with Python. Create a frame, add a label showing the remaining time to it, then launch:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;window = tk.Tk()
time_label = tk.Label(window, text='00 : 00 : 00')
time_label.pack()

window.protocol('WM_DELETE_WINDOW', on_close)

window.mainloop()
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Some resources:&lt;br&gt;
&lt;a href="https://github.com/Picovoice/picovoice/tree/master/demo"&gt;Source code for the tutorial&lt;/a&gt; &lt;br&gt;
&lt;a href="https://medium.com/picovoice/end-to-end-voice-recognition-with-python-41f01c2d4346"&gt;Original Medium Article&lt;/a&gt;&lt;br&gt;
&lt;a href="https://picovoice.ai/docs/picovoice/"&gt;Picovoice SDK&lt;/a&gt;&lt;br&gt;
&lt;a href="https://console.picovoice.ai/login"&gt;Picovoice Console&lt;/a&gt;&lt;/p&gt;

</description>
      <category>100daysofcode</category>
      <category>challenge</category>
      <category>python</category>
      <category>programming</category>
    </item>
    <item>
      <title>Podcast Transcription Software with Express.js</title>
      <dc:creator>Dilek Karasoy</dc:creator>
      <pubDate>Tue, 07 Mar 2023 04:03:34 +0000</pubDate>
      <link>https://dev.to/picovoice/podcast-transcription-software-with-expressjs-2nd7</link>
      <guid>https://dev.to/picovoice/podcast-transcription-software-with-expressjs-2nd7</guid>
      <description>&lt;p&gt;We've had several tutorials with &lt;a href="https://picovoice.ai/platform/cat/"&gt;Leopard Speech-to-Text&lt;/a&gt;. Leopard offers fully on-device audio transcription. Today we'll build podcast transcription software using Leopard Speech-to-Text downloading new items from the RSS feed directly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Backend Set up with Express.js&lt;/strong&gt;&lt;br&gt;
The backend setup will be straightforward. A single endpoint for transcription!&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const express = require('express');

const app = express();
app.use(express.json());
app.use(express.urlencoded({ extended: false }));
app.use(express.static(path.join(__dirname, 'public')));

app.get('/', function (req, res) {
  res.redirect('/index')
});

app.post('/rss-transcribe', async (req, res) =&amp;gt; {
  console.log("RSS feed = " + req.body.rss)
});

module.exports = app;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The test page is designed to allows entering  a podcast RSS feed URL manually which will be sent to the &lt;code&gt;/rss-transcribe&lt;/code&gt; backend for processing.&lt;br&gt;
&lt;strong&gt;2. Parsing the RSS Feed&lt;/strong&gt;&lt;br&gt;
For parsing, use this great &lt;a href="https://www.npmjs.com/package/rss-parser"&gt;RSS parser from Robert Brennan&lt;/a&gt;. It takes the URL and provides a JSON representation of the feed:&lt;br&gt;
const Parser = require('rss-parser');&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;app.post('/rss-transcribe', async (req, res) =&amp;gt; {
  console.log("Parsing RSS feed " + req.body.rss)
  let parser = new Parser();
  let feed = await parser.parseURL(req.body.rss)
  console.log("Parse complete.")
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Fetching the Audio&lt;/strong&gt;&lt;br&gt;
After having the JSON of the RSS, you can find where the podcast audio link was located in the object:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const fs = require('fs');
const path = require('path');
const axios = require('axios');

app.post('/rss-transcribe', async (req, res) =&amp;gt; {

  // .. parse feed

  const podcastAudioUrl = feed.items[0].enclosure.url
  console.log("Fetching file from " + podcastAudioUrl)
  let dlResponse = await axios.get(podcastAudioUrl, { responseType: "arraybuffer" })
  console.log("File obtained.")

  console.log("Writing data to local file...")
  const fileName = `${Math.random().toString(36).substr(2, 5)}.mp3`
  fs.writeFileSync(fileName, dlResponse.data)
  console.log("File write complete")

});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. Transcribing the Podcast&lt;/strong&gt;&lt;br&gt;
Once you have the audio file, it's time to feed it into Leopard Speech-to-Text. Grab your &lt;code&gt;AccessKey&lt;/code&gt; from the &lt;a href="https://console.picovoice.ai/login"&gt;Picovoice Console&lt;/a&gt; for free if you haven't done yet. Replace the placeholder with your &lt;code&gt;AccessKey&lt;/code&gt; and run the code below:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;const { Leopard } = require('@picovoice/leopard-node')

app.post('/rss-transcribe', async (req, res) =&amp;gt; {
  // .. parse feed

  // .. get audio file

  console.log("Transcribing audio...")
  const leo = new Leopard("${YOUR ACCESS KEY HERE}")
  const transcript = leo.processFile(fileName)
  leo.release()
  fs.unlinkSync(fileName)
  console.log("Transcription complete")

  res.send(transcript)
});
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, you can have the transcription being sent in the response.&lt;br&gt;
What's next?&lt;br&gt;
You can take it from here and enrich your solutions. Options are:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;You can write to a text file in the browser for download&lt;/li&gt;
&lt;li&gt;Add automation with a solution like Zapier&lt;/li&gt;
&lt;li&gt;Build front end with a search bar and a new endpoint for queries to make transcriptions searchable.&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;Resource:&lt;br&gt;
&lt;a href="https://medium.com/picovoice/making-a-podcast-transcription-server-with-express-js-e73861f10660"&gt;Original Medium Article&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/Picovoice/leopard/tree/master/demo/expressjs"&gt;Tutorial Source Code&lt;/a&gt;&lt;br&gt;
&lt;a href="https://picovoice.ai/platform/cat/"&gt;Picovoice Leopard&lt;/a&gt;&lt;br&gt;
&lt;a href="https://console.picovoice.ai/login"&gt;Picovoice Console&lt;/a&gt;&lt;/p&gt;

</description>
      <category>100daysofcode</category>
      <category>node</category>
      <category>webdev</category>
      <category>ai</category>
    </item>
    <item>
      <title>"Pico Chess, start a new game": .NET Speech Recognition Tutorial</title>
      <dc:creator>Dilek Karasoy</dc:creator>
      <pubDate>Wed, 01 Mar 2023 04:35:34 +0000</pubDate>
      <link>https://dev.to/picovoice/pico-chess-start-a-new-game-net-speech-recognition-tutorial-2jj1</link>
      <guid>https://dev.to/picovoice/pico-chess-start-a-new-game-net-speech-recognition-tutorial-2jj1</guid>
      <description>&lt;p&gt;&lt;a href="https://github.com/3583Bytes/ChessCore" rel="noopener noreferrer"&gt;ChessCore&lt;/a&gt; is an open-source cross-platform chess engine in .NET Core with a text-based interface. Our team decided to voice enable it to showcase how easy it is to work with &lt;a href="https://picovoice.ai/docs/quick-start/picovoice-dotnet/" rel="noopener noreferrer"&gt;Picovoice .NET SDK&lt;br&gt;
&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/bdaowr0j0fU"&gt;
&lt;/iframe&gt;
&lt;br&gt;
Let's get started:&lt;br&gt;
&lt;strong&gt;1. Remove the text-based interface to replace it with voice user interface:&lt;/strong&gt;&lt;br&gt;
ChessCore keeps the chess-playing engine separate from the interface, allowing developers to replace the text-based interface with voice user interface easily.&lt;/p&gt;

&lt;p&gt;Once you extract the useful items from the original &lt;code&gt;Program.cs&lt;/code&gt;, so you will have something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;class Program
{
    static readonly Engine gameEngine = new Engine();

    static void Main(string[] _)
    {
        // so we can see actual chess pieces on the board!
        Console.OutputEncoding = Encoding.UTF8;

        // start game loop
        RunGame();  
    }

    // game control
    static void RunGame() { ... }
    static void NewGame() { ... }
    static void QuitGame() { ... }  

    // piece movement
    static string MakePlayerMove(string srcSide, string srcFile, string srcRank, 
        string dstSide, string dstFile, string dstRank) { ... }
    static string MakeOpponentMove() { ... }
    static void UndoMove() { ... }

    // end game logic
    static bool CheckEndGame() { ... }
    static string GetEndGameReason() { ... }

    // translation functions
    static byte GetRow(string move) { ... }
    static string GetRow(byte row) { ... }
    static string GetColumn(byte col) { ... }
    static byte GetColumn(string side, string file) { ... }
    static string GetPieceSymbol(ChessPieceColor color, ChessPieceType type) { ... }

    // UTF-8 board to console
    static void DrawBoard(string aboveBoardText) { ... }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2. Design the Voice User Interface&lt;/strong&gt;&lt;br&gt;
To build a hands-free app understanding commands like "Pico Chess, start a new game", we need engines to detect the hotword "Picovoice" and to users' intent "starting a game." The first one is powered by &lt;a href="https://picovoice.ai/platform/porcupine/" rel="noopener noreferrer"&gt;Porcupine Wake Word&lt;/a&gt;, and the latter by &lt;a href="https://picovoice.ai/platform/rhino/" rel="noopener noreferrer"&gt;Rhino Speech-to-Intent&lt;/a&gt;. &lt;br&gt;
&lt;strong&gt;2.1. Train a custom hotword&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Sign up for the &lt;a href="https://console.picovoice.ai/" rel="noopener noreferrer"&gt;Picovoice Console&lt;/a&gt; for free if you haven't and go to the Porcupine section. Simply type “Pico Chess” or hotword of your choice in multiple languages. Then select what platform you want - for a cross-platform experience, train one for Windows, one for Linux and one for macOS.&lt;/p&gt;

&lt;p&gt;2.2. Train a context to understand follow-up commands&lt;br&gt;
Go to the Rhino section on the &lt;a href="https://console.picovoice.ai/" rel="noopener noreferrer"&gt;Picovoice Console&lt;/a&gt; and create a new context. You can design your own model from scratch, but for the sake of simplicity, just download this &lt;a href="https://github.com/laves/ChessCore/tree/master/ChessCore" rel="noopener noreferrer"&gt;YAML file&lt;/a&gt; and import it. It will be easier to adjust the existing context especially if this is your first project. Then train and download the model.&lt;/p&gt;

&lt;p&gt;PS: Grab your AccessKey from the Picovoice Console, while you're there. You'll need it shortly.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;3. Wire it up!&lt;/strong&gt;&lt;br&gt;
Now it's time to add the Picovoice NuGet package and voice AI model files to the ChessCore project.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;static string _platform =&amp;gt; RuntimeInformation.IsOSPlatform(OSPlatform.OSX) ? "mac" :
               RuntimeInformation.IsOSPlatform(OSPlatform.Linux) ? "linux" :
               RuntimeInformation.IsOSPlatform(OSPlatform.Windows) ? "windows" : 
               "";

static void RunGame()
{
    // init picovoice platform
    string accessKey = "..."; // replace with your Picovoice AccessKey
    string keywordPath = $"pico_chess_{_platform}.ppn";
    string contextPath = $"chess_{_platform}.rhn";

    using Picovoice picovoice = Picovoice.Create(
            accessKey,
        keywordPath, 
                wakeWordCallback, 
                contextPath, 
                inferenceCallback);

    DrawBoard();

    // start play
    // ...
}

static void WakeWordCallback()
{
    Console.WriteLine("\n Listening for command...");
}

static void InferenceCallback(Inference inference)
{
    // logic for when Rhino infers an intent
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The .NET SDK &lt;code&gt;Inference class&lt;/code&gt; has three immutable properties:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;IsUnderstood&lt;/code&gt;: whether Rhino Speech-to-Intent matched one of the commands or not&lt;br&gt;
&lt;code&gt;Intent&lt;/code&gt;: if understood, which intent was inferred&lt;br&gt;
&lt;code&gt;Slots&lt;/code&gt;: if understood, a dictionary with data relating to the intent&lt;/p&gt;

&lt;p&gt;If you used the existing YAML file, the intents are &lt;code&gt;move&lt;/code&gt;, &lt;code&gt;newGame&lt;/code&gt;, &lt;code&gt;undo&lt;/code&gt; and &lt;code&gt;quit&lt;/code&gt;. &lt;br&gt;
Please note that &lt;code&gt;Slots&lt;/code&gt; [dictionary for source and destination coordinates] will only be used with move, and will be empty for other intents. So the inference callback will look something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;static void InferenceCallback(Inference inference)
{
    if (inference.IsUnderstood)
    {           
        if (inference.Intent.Equals("move"))
        {
            if (CheckEndGame()) 
                return;

            // get source coordinates
            string srcSide = inference.Slots["srcSide"];
            string srcRank = inference.Slots["srcRank"];
            string srcFile = inference.Slots.ContainsKey("srcFile") ? 
            inference.Slots["srcFile"] : "";

            // get destination cooordinates
            string dstSide = inference.Slots["dstSide"];
            string dstRank = inference.Slots["dstRank"];
            string dstFile = inference.Slots.ContainsKey("dstFile") ? 
            inference.Slots["dstFile"] : "";

            // try to make player move
            string playerMove = MakePlayerMove(srcSide, srcFile, srcRank, 
                                               dstSide, dstFile, dstRank);
            if (playerMove.Equals("Invalid Move"))
            {
                DrawBoard($" {playerMove}\n");
                    return;
            }

            // make opponent move if player move was valid
            string theirMove = MakeOpponentMove();
            DrawBoard($" \u2654  {playerMove}\n \u265A  {theirMove}");

            // end game if necessary
            if (CheckEndGame())
            {
                Console.WriteLine($"\n {GetEndGameReason()}");
                Console.WriteLine($" Say 'new game' to play again.");
            }
        }
        else if (inference.Intent.Equals("undo"))
        {
            UndoLastMove();
        }
        else if (inference.Intent.Equals("newgame"))
        {
            NewGame();
        }
        else if (inference.Intent.Equals("quit"))
        {
            QuitGame();
        }
    }
    else
    {
        DrawBoard(" Didn't understand move.\n");
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;4. Get PicoChess listen to commands:&lt;/strong&gt;&lt;br&gt;
If you think cross-platform microphone control is challenging in .NET, you're not alone. That's why Picovoice built the &lt;code&gt;PvRecorder&lt;/code&gt;.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;static bool _quitGame = false;

static void RunGame()
{       
    // init picovoice platform
    string accessKey = "..."; // replace with your Picovoice AccessKey
    string keywordPath = $"pico_chess_{_platform}.ppn";
    string contextPath = $"chess_{_platform}.rhn";

    using Picovoice picovoice = Picovoice.Create(
            accessKey,
        keywordPath, 
                wakeWordCallback, 
                contextPath, 
                inferenceCallback);

    DrawBoard();

    // create and start recording
    using (PvRecorder recorder = PvRecorder.Create(-1, picovoice.FrameLength))
    {
    recorder.Start();

    Console.WriteLine($"Using device: {recorder.SelectedDevice}");
    Console.WriteLine("Listening...");

    while (!_quitGame)
    {
        short[] pcm = recorder.Read();
        picovoice.Process(pcm);

        Thread.Yield();
    }
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Voila!&lt;/p&gt;

&lt;p&gt;Resources:&lt;br&gt;
&lt;a href="https://medium.com/picovoice/talking-chess-adding-offline-cross-platform-voice-controls-to-chess-in-net-core-f74712b379c3" rel="noopener noreferrer"&gt;Original Medium Article&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/laves/ChessCore" rel="noopener noreferrer"&gt;Tutorial Source Code GitHub&lt;/a&gt;&lt;br&gt;
&lt;a href="https://console.picovoice.ai/" rel="noopener noreferrer"&gt;Picovoice Console&lt;/a&gt;&lt;/p&gt;

</description>
      <category>github</category>
      <category>career</category>
      <category>productivity</category>
    </item>
    <item>
      <title>React Native Speech Recognition Tutorial</title>
      <dc:creator>Dilek Karasoy</dc:creator>
      <pubDate>Tue, 28 Feb 2023 05:00:11 +0000</pubDate>
      <link>https://dev.to/picovoice/react-native-speech-recognition-tutorial-3bih</link>
      <guid>https://dev.to/picovoice/react-native-speech-recognition-tutorial-3bih</guid>
      <description>&lt;p&gt;Native apps of Google and Apple process voice data on the device. However, they do not offer it to other developers. Luckily, Picovoice does. On day 40, we'll go over how to process voice data on device by using &lt;a href="https://picovoice.ai/docs/quick-start/picovoice-react-native/"&gt;Picovoice React Native SDK&lt;/a&gt;. Picovoice SDK combines &lt;a href="https://picovoice.ai/platform/porcupine/"&gt;Porcupine Wake Word&lt;/a&gt; and &lt;a href="https://picovoice.ai/platform/rhino/"&gt;Rhino Speech-to-Intent&lt;/a&gt; engines, enabling commands like &lt;code&gt;"Alexa, set timer for 5 minutes"&lt;/code&gt; but even better! We'll use a custom hotword instead of Alexa, and voice commands will be processed with zero latency.&lt;/p&gt;

&lt;p&gt;&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Eal9vRYUBuk"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Install the latest Picovoice packages:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;npm i @picovoice/react-native-voice-processor
npm i @picovoice/porcupine-react-native
npm i @picovoice/rhino-react-native
npm i @picovoice/picovoice-react-native
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;2.Initialize the Speech Recognition Platform&lt;/strong&gt;&lt;br&gt;
First, grab your &lt;code&gt;AccessKey&lt;/code&gt; for free from the &lt;a href="https://console.picovoice.ai/"&gt;Picovoice Console&lt;/a&gt;.&lt;br&gt;
To keep things straightforward,  we’re going to use the pre-trained hotword model Pico Clock and the pre-trained context model Clock for this tutorial. You can &lt;a href="https://github.com/Picovoice/picovoice/tree/master/demo/react-native-clock"&gt;download pre-trained models here&lt;/a&gt;. However, you can also train custom wake words and contexts on the &lt;a href="https://console.picovoice.ai/"&gt;Picovoice Console&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;Now you should have an &lt;code&gt;AccessKey&lt;/code&gt;, a &lt;code&gt;Porcupine model&lt;/code&gt; (.ppn file), and a &lt;code&gt;Rhino model&lt;/code&gt; (.rhn file). &lt;br&gt;
Let's initialize a &lt;code&gt;PicovoiceManager&lt;/code&gt; in your React Native app.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import {PicovoiceManager} from '@picovoice/picovoice-react-native';

async createPicovoiceManager() {
    const accessKey = "..."; // your Picovoice AccessKey
    try {
        this._picovoiceManager = await PicovoiceManager.create(
            accessKey,
            '/path/to/keyword.ppn',
            this._wakeWordCallback,
            '/path/to/context.rhn',
            this._inferenceCallback,
            (error) =&amp;gt; {
              this._errorCallback(error.message);
            }
        );
    } catch (err) {
        // handle error
    }
}

_wakeWordCallback() {
    // wake word detected!
}

_inferenceCallback(inference) {
    // `inference` has the following fields:
    // (1) isUnderstood
    // (2) intent
    // (3) slots      
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;3. Get Permission to Record Audio&lt;/strong&gt;&lt;br&gt;
To get the permission on &lt;code&gt;iOS&lt;/code&gt;, open your &lt;code&gt;Info.plist&lt;/code&gt; and add the following line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;key&amp;gt;NSMicrophoneUsageDescription&amp;lt;/key&amp;gt;
&amp;lt;string&amp;gt;[Permission explanation]&amp;lt;/string&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;For Android, open your &lt;code&gt;AndroidManifest.xml&lt;/code&gt; and add the following line:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;uses-permission android:name="android.permission.RECORD_AUDIO" /&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then check for permission before proceeding with audio capture:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;let recordAudioRequest;
if (Platform.OS == 'android') {
    // For Android, we need to explicitly ask
    recordAudioRequest = this._requestRecordAudioPermission();
} else {
    // iOS automatically asks for permission
    recordAudioRequest = new Promise(function (resolve, _) {
    resolve(true);
    });
}

recordAudioRequest.then((hasPermission) =&amp;gt; {
    if (!hasPermission) {
        console.error('Required microphone permission was not granted.');        
        return;
      }

    // start feeding Picovoice
    this._picovoiceManager?.start().then((didStart) =&amp;gt; {
    if (didStart) {
      // let app know we're ready to go
    }
  });

});

async _requestRecordAudioPermission() {
    const granted = await PermissionsAndroid.request(
    PermissionsAndroid.PERMISSIONS.RECORD_AUDIO,
    {
        title: 'Microphone Permission',
        message: '[Permission explanation]',
        buttonNeutral: 'Ask Me Later',
        buttonNegative: 'Cancel',
        buttonPositive: 'OK',
    }
    );
    return (granted === PermissionsAndroid.RESULTS.GRANTED)
  }
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Once &lt;code&gt;.start()&lt;/code&gt; called, Picovoice is listening for the hotword “PicoClock” and follow-up commands.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;4. Controlling the App With Voice Inputs&lt;/strong&gt;&lt;br&gt;
In the source code, you can find a simple clock app with three main components: a clock that shows the time, a timer, and a stopwatch.&lt;br&gt;
Let's connect these three components to the Voice User Interface (VUI):&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_wakeWordCallback(keywordIndex){    
  // turn mic blue to show we're listening
  this.setState({    
    isListening: true
  });
}

_inferenceCallback(inference) {
  var tab = this.state.activeTab;  
  if (inference.isUnderstood) {         
    if (inference.intent === 'clock') {
      // show clock
      tab = 'clock';
    } else if (inference.intent === 'timer') {
      // control timer operation
      this._performTimerCommand(inference.slots);
      tab = 'timer';
    } else if (inference.intent === 'setTimer') {
      // set timer duration
      this._setTimer(inference.slots);
      tab = 'timer';
    } else if (inference.intent === 'alarm') {
      // control alarm operation
      this._performAlarmCommand(inference.slots);
      tab = 'clock';
    } else if (inference.intent] === 'setAlarm') {
      // set alarm time
      this._setAlarm(inference.slots);
      tab = 'clock';
    } else if (inference.intent === 'stopwatch') {
      // control stopwatch operation
      this._performStopwatchCommand(inference.slots);
      tab = 'stopwatch';
    }
  }

  // change active tab and show we've stopped listening
  this.setState({
    activeTab: tab,
    isListening: false,
  });
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Then connect each &lt;code&gt;intent&lt;/code&gt; to a specific action taken in the app and pass in the &lt;code&gt;intent’s&lt;/code&gt; &lt;code&gt;slots&lt;/code&gt; as arguments.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;_setTimer(slots) {
  var hours = 0;
  var minutes = 0;
  var seconds = 0;

  // parse duration
  if (slots['hours'] != null) {
    hours = Number.parseInt(slots['hours']);
  }
  if (slots['minutes'] != null) {
    minutes = Number.parseInt(slots['minutes']);
  }
  if (slots['seconds'] != null) {
    seconds = Number.parseInt(slots['seconds']);
  }

  // set timer
  this.setState({
    timerCurrentTime: moment.duration({
      hour: hours,
      minute: minutes,
      second: seconds,
      millisecond: 0,
    }),
    isTimerRunning: true,
  });
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Voila! Once you connect all the functions with the VUI, you have a hands-free and cross-platform clock app.&lt;/p&gt;

&lt;p&gt;Resources:&lt;br&gt;
&lt;a href="https://medium.com/picovoice/add-voice-recognition-to-react-native-without-adding-the-cloud-af9e299336e4"&gt;Original article&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/Picovoice/picovoice/tree/master/demo/react-native-clock"&gt;Source Code&lt;/a&gt;&lt;br&gt;
&lt;a href="https://picovoice.ai/docs/quick-start/picovoice-react-native/"&gt;Picovoice React Native SDK&lt;/a&gt;&lt;/p&gt;

</description>
      <category>100daysofcode</category>
      <category>challenge</category>
      <category>reactnative</category>
      <category>mobile</category>
    </item>
    <item>
      <title>No More "Hey Google"! Add your Wake Phrase to an Android app</title>
      <dc:creator>Dilek Karasoy</dc:creator>
      <pubDate>Fri, 24 Feb 2023 17:27:00 +0000</pubDate>
      <link>https://dev.to/picovoice/no-more-hey-google-add-your-wake-phrase-to-an-android-app-5g1l</link>
      <guid>https://dev.to/picovoice/no-more-hey-google-add-your-wake-phrase-to-an-android-app-5g1l</guid>
      <description>&lt;p&gt;You cannot change Google hotwords "Hey Google", "OK Google" but you can get your Android app have its own wake phrase with &lt;a href="https://picovoice.ai/platform/porcupine/"&gt;Porcupine Wake Word&lt;/a&gt;&lt;br&gt;
&lt;iframe width="710" height="399" src="https://www.youtube.com/embed/Qpen_Y4sjV8"&gt;
&lt;/iframe&gt;
&lt;/p&gt;

&lt;p&gt;Let's get started&lt;br&gt;
&lt;strong&gt;Add the Porcupine Wake Word Library&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Make sure you have a reference to Maven Central in your project’s &lt;code&gt;build.gradle&lt;/code&gt; file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;repositories {
  mavenCentral()
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Add the following reference to your app’s &lt;/p&gt;

&lt;p&gt;&lt;code&gt;build.gradle&lt;/code&gt;&lt;br&gt;
 file:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;dependencies {
  implementation 'ai.picovoice:porcupine-android:${LATEST_VERSION}'
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Create a Background Service&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;public class PorcupineService extends Service {

    @Override
    public int onStartCommand(Intent intent, int flags, int startId) {
        return super.onStartCommand(intent, flags, startId);
    }

    @Nullable
    @Override
    public IBinder onBind(Intent intent) {
        return null;
    }

    @Override
    public void onDestroy() {        
        super.onDestroy();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;in your &lt;code&gt;MainActivity&lt;/code&gt;, add code to start and stop the &lt;code&gt;PorcupineService&lt;/code&gt;:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private void startService() {
    Intent serviceIntent = new Intent(this, PorcupineService.class);
    ContextCompat.startForegroundService(this, serviceIntent);
}

private void stopService() {
    Intent serviceIntent = new Intent(this, PorcupineService.class);
    stopService(serviceIntent);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Request Audio Permissions&lt;/strong&gt;&lt;br&gt;
In &lt;code&gt;AndroidManifest.xml&lt;/code&gt;, add this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;&amp;lt;uses-permission android:name="android.permission.RECORD_AUDIO"/&amp;gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Check if you have permission to record audio in the &lt;code&gt;MainActivity&lt;/code&gt; and if not, ask the user for it. Add the following code to achieve this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;private boolean hasRecordPermission() {
    return ActivityCompat.checkSelfPermission(this, Manifest.permission.RECORD_AUDIO) 
        == PackageManager.PERMISSION_GRANTED;
}

private void requestRecordPermission() {
    ActivityCompat.requestPermissions(this, new String[]{Manifest.permission.RECORD_AUDIO}, 0);
}

@Override
public void onRequestPermissionsResult(int requestCode, 
                                       @NonNull String[] permissions, 
                                       @NonNull int[] grantResults) {    
    if (grantResults.length == 0 || 
        grantResults[0] == PackageManager.PERMISSION_DENIED) {
        // handle permission denied
    } else {
        startService();
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Launch Wake Word Engine from a Service&lt;/strong&gt;&lt;br&gt;
For this demo, we'll use one of built-in keywords, ‘Computer’. However, you can train a custom wake phrase on the &lt;a href="https://console.picovoice.ai/"&gt;Picovoice Console&lt;/a&gt; by signing up for free.&lt;/p&gt;

&lt;p&gt;You also need an &lt;code&gt;AccessKey&lt;/code&gt; which can be found on your &lt;a href="https://console.picovoice.ai/"&gt;Picovoice Console&lt;/a&gt; dashboard.&lt;/p&gt;

&lt;p&gt;In our &lt;code&gt;PorcupineService&lt;/code&gt; class, we’ll create an instance of &lt;code&gt;PorcupineManager&lt;/code&gt;to handle audio capture and processing. The service class now looks like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import ai.picovoice.porcupine.Porcupine;
import ai.picovoice.porcupine.PorcupineException;
import ai.picovoice.porcupine.PorcupineManager;

public class PorcupineService extends Service {
  private String accessKey = "..."; // your Picovoice AccessKey
  private PorcupineManager porcupineManager;  

  @Override
  public int onStartCommand(Intent intent, int flags, int startId) {
    try {
        porcupineManager = new PorcupineManager.Builder()
                .setAccessKey(accessKey)
                .setKeyword(Porcupine.BuiltInKeyword.COMPUTER)
                .setSensitivity(0.7f)
                .build(getApplicationContext(),
                        (keywordIndex) -&amp;gt; {
                          // wake word detected!
                        });
        porcupineManager.start();
    } catch (PorcupineException e) {
        Log.e("PORCUPINE_SERVICE", e.toString());
    }
    return super.onStartCommand(intent, flags, startId);
  }

  @Nullable
  @Override
  public IBinder onBind(Intent intent) {
      return null;
  }

  @Override
  public void onDestroy() {
      try {
          porcupineManager.stop();
          porcupineManager.delete();
      } catch (PorcupineException e) {
          Log.e("PORCUPINE", e.toString());
      }
      super.onDestroy();
  }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Voila!&lt;/p&gt;

&lt;p&gt;Resources:&lt;br&gt;
The tutorial was originally published on &lt;a href="https://medium.com/picovoice/no-way-google-build-your-own-wake-word-service-on-android-339a0189ff4c"&gt;Medium&lt;/a&gt;.&lt;br&gt;
&lt;a href="https://picovoice.ai/docs/quick-start/porcupine-android/"&gt;Porcupine Android SDK&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/Picovoice/porcupine/tree/master/demo/android/Service"&gt;Tutorial Source Code&lt;/a&gt;&lt;br&gt;
&lt;a href="https://picovoice.ai/"&gt;Picovoice.ai&lt;/a&gt;&lt;/p&gt;

</description>
      <category>100daysofcode</category>
      <category>challenge</category>
      <category>android</category>
      <category>mobile</category>
    </item>
    <item>
      <title>Stuck with Java Speech API?</title>
      <dc:creator>Dilek Karasoy</dc:creator>
      <pubDate>Thu, 23 Feb 2023 16:59:24 +0000</pubDate>
      <link>https://dev.to/picovoice/stuck-with-java-speech-api-2ppf</link>
      <guid>https://dev.to/picovoice/stuck-with-java-speech-api-2ppf</guid>
      <description>&lt;p&gt;If you find adding voice inputs to a Java application difficult, you're not alone. JDK's Speech API relies on outdated products and third-party cloud providers. &lt;/p&gt;

&lt;p&gt;But we have a good news, on day 37, we'll add custom voice commands, like &lt;code&gt;Jarvis, turn off the lights&lt;/code&gt;, with &lt;a href="https://picovoice.ai/docs/quick-start/picovoice-java/" rel="noopener noreferrer"&gt;Picovoice Java SDK&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;The Picovoice SDK combines &lt;a href="https://picovoice.ai/platform/porcupine/" rel="noopener noreferrer"&gt;Porcupine Wake Word&lt;/a&gt; and &lt;a href="https://picovoice.ai/platform/rhino/" rel="noopener noreferrer"&gt;Rhino Speech-to-Intent&lt;/a&gt; engines. Wake words like &lt;code&gt;Jarvis&lt;/code&gt;, powered by Porcupine and follow-up commands like &lt;code&gt;turn off the lights&lt;/code&gt; powered by Rhino.&lt;/p&gt;

&lt;p&gt;Let's get started&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Get the latest version of the SDK from  Maven Central Repository:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;ai.picovoice:picovoice-java:${version}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Design and train models on the Picovoice Platform
While developers can train and adapt custom voice AI models on the Picovoice Console. However, you can use pre-trained ones, too! For this tutorial, we'll use the pre-trained &lt;code&gt;[Jarvis](https://github.com/Picovoice/porcupine/tree/master/resources/keyword_files)&lt;/code&gt; wake word and the &lt;code&gt;[Smart Lighting](https://github.com/Picovoice/rhino/tree/master/resources/contexts)&lt;/code&gt; context, which understands commands that change the color/state of lights. &lt;/li&gt;
&lt;li&gt;Get an AccessKey Picovoice 
If you still haven't, create an account on the &lt;a href="https://console.picovoice.ai/" rel="noopener noreferrer"&gt;Picovoice Console&lt;/a&gt; for free and grab your &lt;code&gt;AccessKey&lt;/code&gt;.&lt;/li&gt;
&lt;li&gt;Initialize the Picovoice Platform
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import ai.picovoice.picovoice.*;

final String accessKey = "..."; // your Picovoice AccessKey
final String keywordPath = "res/path/to/jarvis.ppn";
final String contextPath = "res/path/to/smart_lighting.rhn";

PicovoiceWakeWordCallback wakeWordCallback = () -&amp;gt; { 
  System.out.println("Wake word detected!");
  // let user know wake word was detected
};
PicovoiceInferenceCallback inferenceCallback = inference -&amp;gt; { 
  if (inference.getIsUnderstood()) {
    final String intent = inference.getIntent();
    final Map&amp;lt;String, String&amp;gt; slots = inference.getSlots();
    // use intent and slots to trigger action
  }
}; 

Picovoice picovoice = new Picovoice.Builder()
                    .setAccessKey(accessKey)
                    .setKeywordPath(keywordPath)
                    .setWakeWordCallback(wakeWordCallback)
                    .setContextPath(contextPath)
                    .setInferenceCallback(inferenceCallback)
                    .build();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Do not forget to replace &lt;code&gt;AccessKey&lt;/code&gt;, &lt;code&gt;KeywordPath&lt;/code&gt;, and &lt;code&gt;ContextPath&lt;/code&gt; placeholders. Copy your AccessKey from Picovoice Console. The path for the downloaded Porcupine keyword and Rhino Context files, depends on where you save them when you download.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Read and Process Microphone Audio
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import javax.sound.sampled.*;

// get default audio capture device
AudioFormat format = new AudioFormat(16000f, 16, 1, true, false);
DataLine.Info dataLineInfo = new DataLine.Info(TargetDataLine.class, format);
TargetDataLine micDataLine;
try {
    micDataLine = (TargetDataLine) AudioSystem.getLine(dataLineInfo);
    micDataLine.open(format);
} catch (LineUnavailableException e) {
    System.err.println("Failed to get a valid audio capture device.");    
    return;
}

// start audio capture
micDataLine.start();
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ol&gt;
&lt;li&gt;Create a loop that reads microphone data and passes it to Picovoice:
&lt;/li&gt;
&lt;/ol&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// buffers for processing audio
short[] picovoiceBuffer = new short[picovoice.getFrameLength()];
ByteBuffer captureBuffer = ByteBuffer.allocate(picovoice.getFrameLength() * 2);
captureBuffer.order(ByteOrder.LITTLE_ENDIAN);

int numBytesRead;
boolean recordingCancelled = false;
while (!recordingCancelled) {

    // read a buffer of audio
    numBytesRead = micDataLine.read(captureBuffer.array(), 0, captureBuffer.capacity());

    // don't pass to Picovoice if we don't have a full buffer
    if (numBytesRead != picovoice.getFrameLength() * 2) {
        continue;
    }

    // copy into 16-bit buffer
    captureBuffer.asShortBuffer().get(picovoiceBuffer);

    // process with picovoice
    picovoice.process(picovoiceBuffer);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This tutorial was originally published on &lt;a href="https://medium.com/picovoice/prioritizing-privacy-add-offline-speech-recognition-to-a-java-application-1c864574fb7e" rel="noopener noreferrer"&gt;Medium&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Resources:&lt;br&gt;
&lt;a href="https://github.com/Picovoice/picovoice/tree/master/demo/java-swing" rel="noopener noreferrer"&gt;Source Code&lt;/a&gt;&lt;br&gt;
&lt;a href="https://picovoice.ai/" rel="noopener noreferrer"&gt;Picovoice&lt;/a&gt;&lt;br&gt;
Picovoice Java SDK (&lt;a href="https://picovoice.ai/docs/quick-start/picovoice-java/" rel="noopener noreferrer"&gt;https://picovoice.ai/docs/quick-start/picovoice-java/&lt;/a&gt;)&lt;/p&gt;

</description>
      <category>watercooler</category>
    </item>
    <item>
      <title>Hotword Activated Angular Application with Porcupine and Web Speech API</title>
      <dc:creator>Dilek Karasoy</dc:creator>
      <pubDate>Wed, 22 Feb 2023 17:32:07 +0000</pubDate>
      <link>https://dev.to/picovoice/hotword-activated-angular-application-with-porcupine-and-web-speech-api-5b27</link>
      <guid>https://dev.to/picovoice/hotword-activated-angular-application-with-porcupine-and-web-speech-api-5b27</guid>
      <description>&lt;p&gt;On day 36, Let's build an Angular app that is activated by a hotword to run the Web Speech API. We'll use &lt;a href="https://picovoice.ai/docs/quick-start/porcupine-angular/" rel="noopener noreferrer"&gt;Porcupine Angular SDK&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;1. Install the packages&lt;/strong&gt;&lt;br&gt;
Set up a new Angular project and install the following packages:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;yarn add @picovoice/porcupine-angular @picovoice/web-voice-processor
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;code&gt;web-voice-processor&lt;/code&gt; accesses the microphone  and converts the stream of audio data into speech recognition format.&lt;br&gt;
&lt;code&gt;porcupine-angular&lt;/code&gt; provides the Angular &lt;code&gt;PorcupineService&lt;/code&gt;.&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Go to &lt;a href="https://github.com/Picovoice/porcupine/tree/master/demo/angular-stt" rel="noopener noreferrer"&gt;GitHub and download&lt;/a&gt; the demo repository
and 
&lt;code&gt;git clone https://github.com/Picovoice/porcupine.git&lt;/code&gt;
&lt;code&gt;cd porcupine/demo/angular-stt&lt;/code&gt;
&lt;code&gt;yarn&lt;/code&gt;
&lt;code&gt;yarn start&lt;/code&gt;
&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;This will start a server on &lt;code&gt;http://localhost:4200&lt;/code&gt;. Upon loading, allow microphone permission. You will need to enter your &lt;code&gt;AccessKey&lt;/code&gt; from the &lt;a href="https://console.picovoice.ai/login" rel="noopener noreferrer"&gt;Picovoice Console&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Now, the Angular app is able to start with the hotword “Okay Google" and transcribe speech to text with Web Speech API. Web Speech API is only available for Chrome. If you're looking for a transcription engine runs in all modern browsers, check out &lt;a href="https://picovoice.ai/platform/cat/" rel="noopener noreferrer"&gt;Picovoice STT&lt;/a&gt;s.&lt;/p&gt;

&lt;p&gt;Resources:&lt;br&gt;
&lt;a href="https://medium.com/picovoice/voice-enabling-an-angular-app-with-wake-words-dae4c9f26f9f" rel="noopener noreferrer"&gt;Original Artcile on Medium&lt;/a&gt;&lt;br&gt;
&lt;a href="https://picovoice.ai/platform/porcupine/" rel="noopener noreferrer"&gt;Picovoice Porcupine&lt;/a&gt;&lt;br&gt;
&lt;a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Speech_API" rel="noopener noreferrer"&gt;WebSpeech API&lt;/a&gt;&lt;br&gt;
&lt;a href="https://github.com/Picovoice/porcupine/tree/master/demo/angular-stt" rel="noopener noreferrer"&gt;GitHub Repository for the Tutorial&lt;/a&gt;&lt;/p&gt;

</description>
      <category>backend</category>
      <category>resources</category>
      <category>gratitude</category>
      <category>developer</category>
    </item>
  </channel>
</rss>
