<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by mtuchi on Medium]]></title>
        <description><![CDATA[Stories by mtuchi on Medium]]></description>
        <link>https://medium.com/@mtuchi?source=rss-ee612b1bbf7a------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/2*v8oMam3lGJoDUdFfX2k3Vg.png</url>
            <title>Stories by mtuchi on Medium</title>
            <link>https://medium.com/@mtuchi?source=rss-ee612b1bbf7a------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 22:05:26 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@mtuchi/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Speech Recognition in Python]]></title>
            <link>https://mtuchi.medium.com/speech-recognition-in-python-460abde26059?source=rss-ee612b1bbf7a------2</link>
            <guid isPermaLink="false">https://medium.com/p/460abde26059</guid>
            <category><![CDATA[python]]></category>
            <category><![CDATA[python-programming]]></category>
            <category><![CDATA[speech-recognition]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[mtuchi]]></dc:creator>
            <pubDate>Thu, 10 Mar 2022 17:55:57 GMT</pubDate>
            <atom:updated>2022-03-10T17:55:57.098Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/635/1*1lMEx1d0bSGgttM2YQ_xYA.png" /></figure><p>Speech Recognition is the ability of a machine or program to identify words and phrases in spoken language and convert them to a machine-readable format.</p><p>You have probably seen it on Sci-fi, and personal assistants like Siri, Cortana, and Google Assistant.</p><p>In this tutorial, you’re going to learn how to build your own python program that is capable of performing converting your sound to textual information.</p><h3>Program Overview</h3><p>Our Python will be capable of recording sound through a Microphone on your Computer, and then it will send the speech to google speech recognition API and return a decoded text to us.</p><h3>Requirements</h3><p><strong>Installation</strong></p><pre>pip install PyAudio <br>pip install SpeechRecognition</pre><p>Through<em> SpeechRecognition</em> Library you can perform speech recognition, with support for several engines and APIs, online and offline.</p><p>In this tutorial, we are going to use Google Speech recognition API which is free for basic<br>uses perhaps it has a limit of requests you can send over a certain time.</p><p>Throughout this tutorial, you will learn to perform Speech Recognition using sound that is directly fed from <strong>Microphone</strong> also using<br><strong>Audio Source</strong> from File</p><h3>Speech Recognition from Microphone</h3><p>When Performing Speech Recognition from Microphone, we need to record the audio from the microphone and then send it to google<br>Speech to text recognition engine and then it will give us the textual output which will print out to the Screen</p><p><strong>Steps involved</strong></p><ul><li>Recording Audio from Microphone ( PyAudio)</li><li>Sending Audio to the Speech recognition engine</li><li>Printing the Recognized text to the screen</li></ul><p><strong>app.py</strong></p><pre>import speech_recognition as srrecognizer = sr.Recognizer()&#39;&#39;&#39; recording the sound &#39;&#39;&#39;with sr.Microphone() as source:<br>    print(&quot;Adjusting noise &quot;)<br>    recognizer.adjust_for_ambient_noise(source, duration=1)<br>    print(&quot;Recording for 4 seconds&quot;)<br>    recorded_audio = recognizer.listen(source, timeout=4)<br>    print(&quot;Done recording&quot;)&#39;&#39;&#39; Recorgnizing the Audio &#39;&#39;&#39;<br>try:<br>    print(&quot;Recognizing the text&quot;)<br>    text = recognizer.recognize_google(<br>            recorded_audio, <br>            language=&quot;en-US&quot;<br>        )<br>    print(&quot;Decoded Text : {}&quot;.format(text))except Exception as ex:<br>    print(ex)</pre><h3>Speech Recognition from Audio File</h3><p>When it comes to performing Speech Recognition from Audio line only one line of code is going to change instead of using a Microphone as a source of Audio, we will give a path to our Audio File we want to transcribe to text</p><p>On Demo, I have used the below sample audio</p><p><a href="https://kalebujordan.com/wp-content/uploads/2020/09/speech.wav">Sample Audio</a></p><p>Our Code looks like this</p><p><strong>app_audio.py</strong></p><pre>import speech_recognition as srrecognizer = sr.Recognizer()&#39;&#39;&#39; recording the sound &#39;&#39;&#39;with sr.AudioFile(&quot;./sample_audio/speech.wav&quot;) as source:<br>    recorded_audio = recognizer.listen(source)<br>    print(&quot;Done recording&quot;)&#39;&#39;&#39; Recorgnizing the Audio &#39;&#39;&#39;<br>try:<br>    print(&quot;Recognizing the text&quot;)<br>    text = recognizer.recognize_google(<br>            recorded_audio, <br>            language=&quot;en-US&quot;<br>        )<br>    print(&quot;Decoded Text : {}&quot;.format(text))except Exception as ex:<br>    print(ex)</pre><p><strong>Output :</strong></p><pre>kalebu@kalebu-PC:~$ python3 app_audio.py <br>Done recording<br>Recognizing the text<br>Decoded Text : python programming is the best of all by Jordan</pre><h3>Speech Recognition from long Audio Source</h3><p>When you have very long audio, loading the whole audio to Memory and sending it over API can be a very slow process, to overcome that we have to split the long audio source into small chunks and then performing speech recognition on those individual chunks</p><p>We are going to use <strong>pydub</strong> to split the Long Audio Source into those small chunks</p><p>To install pydub just use pip</p><pre>$ pip install pydub</pre><p>Here is <a href="https://kalebujordan.com/wp-content/uploads/2020/09/long_audio.mp3">Sample long audio</a> that I have used on this tutorial</p><p>Below is a sample Python code that loads the long audio, split into the segment, and then performing the Speech recognition on those individual chunks to to learn more about splitting the audio you can check out <a href="https://campus.datacamp.com/courses/spoken-language-processing-in-python/manipulating-audio-files-with-pydub?ex=10">DataCamp Tutorial</a></p><p>long_audio.py</p><pre>import os <br>from pydub import AudioSegment<br>import speech_recognition as sr<br>from pydub.silence import split_on_silencerecognizer = sr.Recognizer()def load_chunks(filename):<br>    long_audio = AudioSegment.from_mp3(filename)<br>    audio_chunks = split_on_silence(<br>        long_audio, min_silence_len=1800,<br>        silence_thresh=-17<br>    )<br>    return audio_chunksfor audio_chunk in load_chunks(&#39;./sample_audio/long_audio.mp3&#39;):<br>    audio_chunk.export(&quot;temp&quot;, format=&quot;wav&quot;)<br>    with sr.AudioFile(&quot;temp&quot;) as source:<br>        audio = recognizer.listen(source)<br>        try:<br>            text = recognizer.recognize_google(audio)<br>            print(&quot;Chunk : {}&quot;.format(text))<br>        except Exception as ex:<br>            print(&quot;Error occured&quot;)<br>            print(ex)print(&quot;++++++&quot;)</pre><p>Output :</p><pre>$ python long_audio.py<br>    Chunk : by the time you finish reading this tutorial you have already covered several techniques and natural then<br>    Chunk : learn more<br>    Chunk : forgetting to subscribe to be updated on upcoming tutorials<br>    ++++++</pre><p>Hope you had a good time playing with Speech Recognition in Python</p><p>The full code for is this tutorial is available at My <a href="https://github.com/Kalebu/Python-Speech-Recognition-">GITHUB PROFILE</a></p><p>In case of anything, comment, suggestion, difficulties, drop it in the comment box and I will get back to you ASAP.</p><h4><strong>About The Author</strong></h4><figure><img alt="Leading the AI Revolution in Africa || Techpreneur || Machine Learning Engineer || Founder &amp; CEO @NeuroTech_HQ @sarufi_ai" src="https://cdn-images-1.medium.com/max/400/1*k78oWkj7E113BJXBcaWvpA.jpeg" /><figcaption>Jordan Kalebu</figcaption></figure><blockquote>Jordan Kalubu</blockquote><blockquote>Leading the AI Revolution in Africa || Techpreneur || Machine Learning Engineer || Founder &amp; CEO <a href="https://twitter.com/NeuroTech_HQ">@NeuroTech_HQ</a> <a href="https://twitter.com/sarufi_ai">@sarufi_ai</a></blockquote><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=460abde26059" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Rotten Bytes Issue #1]]></title>
            <link>https://mtuchi.medium.com/rotten-bytes-issue-1-41379ad6306?source=rss-ee612b1bbf7a------2</link>
            <guid isPermaLink="false">https://medium.com/p/41379ad6306</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[newsletter]]></category>
            <dc:creator><![CDATA[mtuchi]]></dc:creator>
            <pubDate>Mon, 21 Feb 2022 12:30:25 GMT</pubDate>
            <atom:updated>2022-02-21T12:30:25.547Z</atom:updated>
            <content:encoded><![CDATA[<p>A curated blended mix of life, tech and inspiration</p><h4><a href="https://commits.top/tanzania.html?utm_campaign=Rotten%20Bytes&amp;utm_medium=email&amp;utm_source=Revue%20newsletter">Most active GitHub users in Tanzania</a></h4><p><a href="https://commits.top/tanzania.html">commits.top</a></p><p>I am happy to see the open source community growing in Tanzania and luckily i know few people leading the charts in <em>commits.top</em>(A list of most active GitHub users in Tanzania. ), I am really inspired to see <strong>Khadija Mahanga</strong> on the top 20 most active users on GitHub. I think more needs to be done and as an open source enthusiast it’s my job to advocate for open source</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*QUBdIg1sSzJMHN2c" /></figure><p><a href="https://skyline.github.com/mtuchi/2021?utm_campaign=Rotten%20Bytes&amp;utm_medium=email&amp;utm_source=Revue%20newsletter"><strong>Buildings i built in 2021 through contributions on GitHub</strong></a><strong> — </strong><a href="https://skyline.github.com/mtuchi/2021"><strong>skyline.github.com</strong></a></p><p>I am obsessed with GitHub Skyline since it was launched. It simply creates 3D model of the GitHub contributions made by <em>@githubusername </em>in <em>year</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*CiScfA25-nrNxwi6" /></figure><p><a href="https://www.notion.so/Top-Python-Resources-23a1086189014ac79307b81b1e19cd25?utm_campaign=Rotten%20Bytes&amp;utm_medium=email&amp;utm_source=Revue%20newsletter"><strong>Top Python Resources </strong></a><strong>— </strong><a href="https://www.notion.so/Top-Python-Resources-23a1086189014ac79307b81b1e19cd25"><strong>www.notion.so</strong></a> <br> Hi there, I’m kalebu, in this notion I have curated top resources for learning and advancing your python skills, take your time going through them;</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*znyLwfJ2zOT2jCLG" /></figure><p><a href="https://foundation.mozilla.org/sw/blog/translating-kiswahili-software-versus-human/?utm_campaign=Rotten%20Bytes&amp;utm_medium=email&amp;utm_source=Revue%20newsletter"><strong>Mozilla Foundation — Kutafsiri Lugha ya Kiswahili: Programu Dhidi ya Binadamu</strong></a><strong> — </strong><a href="https://foundation.mozilla.org/sw/blog/translating-kiswahili-software-versus-human/"><strong>foundation.mozilla.org</strong></a> <br> Kutafsiri kati ya lugha mbili au zaidi ni kazi ambayo, hapo awali, ni binadamu pekee ambao wangeifanya. Siku hizi, inaweza kufanywa na mashine, yaani ko…</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*L09SruCy7RATTMXB" /></figure><p><a href="https://www.siteinspire.com/websites?utm_campaign=Rotten%20Bytes&amp;utm_medium=email&amp;utm_source=Revue%20newsletter"><strong>For website inspiration — 🖱 Siteinspire</strong></a><strong> — </strong><a href="https://www.siteinspire.com/websites"><strong>www.siteinspire.com</strong></a> <br> A showcase of the best web design inspiration, featuring over 7,000 websites and profiles of the digital agencies, designers and developers who made them.</p><figure><img alt="" src="https://cdn-images-1.medium.com/proxy/0*PBN1yuMyUrrqZXNl" /></figure><p><a href="https://quillbot.com/?utm_campaign=Rotten%20Bytes&amp;utm_medium=email&amp;utm_source=Revue%20newsletter"><strong>QuillBot’s paraphrasing tool helps millions of people rewrite and enhance any sentence, paragraph, or article using state-of-the-art AI.</strong></a><strong> — </strong><a href="https://quillbot.com/"><strong>quillbot.com</strong></a> <br> QuillBot’s paraphrasing tool is trusted by millions worldwide to rewrite sentences, paragraphs, or articles using state-of-the-art AI.</p><h4><a href="https://t.me/afrominiac?utm_campaign=Rotten%20Bytes&amp;utm_medium=email&amp;utm_source=Revue%20newsletter">Join my Telegram Channel 👉🏽 @afrominiac</a></h4><p><a href="https://t.me/afrominiac">t.me</a></p><p>I started a side hustle, the brand name is Afrominiac. Since i love computer gadgets and accessories, why not sell them 🤔 ?. you can find me on telegram, twitter, instagram and tiktok</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=41379ad6306" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[How to assemble Air Quality Sensors “The LEGO way” — Part One]]></title>
            <link>https://mtuchi.medium.com/how-to-assemble-air-quality-sensors-the-lego-way-part-one-7978d354e92a?source=rss-ee612b1bbf7a------2</link>
            <guid isPermaLink="false">https://medium.com/p/7978d354e92a</guid>
            <category><![CDATA[sensors]]></category>
            <category><![CDATA[internet-of-things]]></category>
            <category><![CDATA[iot]]></category>
            <category><![CDATA[sensorsafrica]]></category>
            <category><![CDATA[air-quality]]></category>
            <dc:creator><![CDATA[mtuchi]]></dc:creator>
            <pubDate>Tue, 02 Jul 2019 15:36:37 GMT</pubDate>
            <atom:updated>2019-07-02T15:36:37.260Z</atom:updated>
            <content:encoded><![CDATA[<h3>How to assemble Air Quality Sensors “The LEGO way” — Part One</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Aj5Lt6Zga2aVJ089UkRsMA.jpeg" /><figcaption>Courtesy of <a href="https://medium.com/u/799bce66d4eb">Code For Africa</a></figcaption></figure><blockquote>It’s not a perfect guide but worth sharing. <br>Share your feedback if this is of good use to you.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/768/1*YVCvCwFPoAa7XeFBqRso5w.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/972/1*d2Tjly2tTW4-ZN6PvGSTYg.gif" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*rMHol9SrVK3d79qc2wDpng.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IU-kbZZBRKvxp8-MbGDgZg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*0xAiZQymUCyzghtTVfdu-w.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gdCrBZXCsJBMMS7kTM2Nvw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*JYJ2mQwD7ozEILbUj4k7Vg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*spdd2oPy5voZo6zQDCnG2A.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*lf4kP4y1t00TOypJMj4T6g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XK7oxUqT-LO6XGM3Sso_3g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*HA1rpWKKFHTQNDOPWi_WPw.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*3roqd5iL8QlTZ4wZPWwYnA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*OQzS0z_LOjYS7UbfrkZ3yQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Ri4u_3w3RHNVZ7TaPi9RdQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*cJOLOhCIntVo87NDyvarVg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*VszoBLF0rPtsY_JOUYEyiA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*P6XScjmlr7KmnqBBf6_-RA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Jgorimx23lKwyc6GQujRXQ.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*ibaWHlV5KqtD3xfqlbnCfA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*IRNQMG9I5HiEb0YfkyvBew.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*1BSHsTgW0x3RzGL5DIQXcg.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*zVa14OJpZM5rojs-U3w58g.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*KR8XiYW4nR4SHPSj-vmXbA.jpeg" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7bUOWGyJQvPapCQZghh_RQ.jpeg" /></figure><p><a href="https://medium.com/u/ee612b1bbf7a"><em>Mtuchi</em></a><em> is passionate about technology, coffee, DIY, good food and wants to be a front end architecture when he grows up.</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/48/1*xMrDubj0R5lHDr-CKLrTIQ@2x.png" /><figcaption><a href="https://twitter.com/mtuchidev">Follow Me</a></figcaption></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/48/1*zJp42uAxS4rbNQ7Ar1aW9Q@2x.png" /><figcaption><a href="https://www.instagram.com/mtuchidev/">Follow Me</a></figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7978d354e92a" width="1" height="1" alt="">]]></content:encoded>
        </item>
    </channel>
</rss>