<?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: Abhishek Kumar</title>
    <description>The latest articles on DEV Community by Abhishek Kumar (@abhishek_kumar_529).</description>
    <link>https://dev.to/abhishek_kumar_529</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.us-east-2.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F4027365%2F24e2fb6d-bdd4-45da-b54a-38c3ecdacb2d.png</url>
      <title>DEV Community: Abhishek Kumar</title>
      <link>https://dev.to/abhishek_kumar_529</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/abhishek_kumar_529"/>
    <language>en</language>
    <item>
      <title>How We Built a Hindi Voice Assistant in 48 Hours Using Sarvam AI — HackHazards 2026</title>
      <dc:creator>Abhishek Kumar</dc:creator>
      <pubDate>Mon, 13 Jul 2026 13:58:09 +0000</pubDate>
      <link>https://dev.to/abhishek_kumar_529/how-we-built-a-hindi-voice-assistant-in-48-hours-using-sarvam-ai-hackhazards-2026-591c</link>
      <guid>https://dev.to/abhishek_kumar_529/how-we-built-a-hindi-voice-assistant-in-48-hours-using-sarvam-ai-hackhazards-2026-591c</guid>
      <description>&lt;h1&gt;
  
  
  How We Built a Hindi Voice Assistant in 48 Hours
&lt;/h1&gt;

&lt;p&gt;Using Sarvam AI — HackHazards 2026&lt;/p&gt;

&lt;h2&gt;
  
  
  Who We Are
&lt;/h2&gt;

&lt;p&gt;We are Team Victors — a 4-member team competing in &lt;br&gt;
HackHazards 2026. This is the story of how we built &lt;br&gt;
a fully working Hindi Voice Assistant mobile app in &lt;br&gt;
under 48 hours, using Sarvam AI's Indian language APIs &lt;br&gt;
and Expo React Native.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Problem We Wanted to Solve
&lt;/h2&gt;

&lt;p&gt;There are 528 million Hindi speakers in India.&lt;/p&gt;

&lt;p&gt;Most of them can speak fluently but struggle with &lt;br&gt;
English-first digital tools. A farmer who wants to &lt;br&gt;
know about PM-KISAN schemes has no simple way to &lt;br&gt;
just ask in Hindi and get a spoken answer back. &lt;br&gt;
A student in a small town can't easily type English &lt;br&gt;
queries into Google.&lt;/p&gt;

&lt;p&gt;These people don't need translation. They need a voice.&lt;/p&gt;

&lt;p&gt;So we built one.&lt;/p&gt;


&lt;h2&gt;
  
  
  What We Built
&lt;/h2&gt;

&lt;p&gt;&lt;strong&gt;Hindi Voice Assistant&lt;/strong&gt; — a mobile app where you:&lt;/p&gt;

&lt;ol&gt;
&lt;li&gt;Press a mic button and speak in Hindi&lt;/li&gt;
&lt;li&gt;The app listens, understands, and generates a Hindi answer&lt;/li&gt;
&lt;li&gt;The answer is displayed as text AND spoken back to you in Hindi&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;No typing. No English. No barriers.&lt;/p&gt;

&lt;p&gt;🎥 &lt;strong&gt;Watch the demo:&lt;/strong&gt; &lt;a href="https://youtube.com/shorts/Rt4l1aldhrg?feature=share" rel="noopener noreferrer"&gt;https://youtube.com/shorts/Rt4l1aldhrg?feature=share&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;💻 &lt;strong&gt;GitHub:&lt;/strong&gt; &lt;a href="https://github.com/abhishek220205-hash/HackHazards-Voice-App" rel="noopener noreferrer"&gt;https://github.com/abhishek220205-hash/HackHazards-Voice-App&lt;/a&gt;&lt;/p&gt;


&lt;h2&gt;
  
  
  Tech Stack
&lt;/h2&gt;

&lt;div class="table-wrapper-paragraph"&gt;&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
&lt;th&gt;Layer&lt;/th&gt;
&lt;th&gt;Technology&lt;/th&gt;
&lt;/tr&gt;
&lt;/thead&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td&gt;Frontend&lt;/td&gt;
&lt;td&gt;React Native + Expo SDK 54&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Backend&lt;/td&gt;
&lt;td&gt;Node.js + Express&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Deployment&lt;/td&gt;
&lt;td&gt;Render (free tier)&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Speech to Text&lt;/td&gt;
&lt;td&gt;Sarvam Saarika v2.5&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;AI Chat&lt;/td&gt;
&lt;td&gt;Sarvam-30b&lt;/td&gt;
&lt;/tr&gt;
&lt;tr&gt;
&lt;td&gt;Text to Speech&lt;/td&gt;
&lt;td&gt;Sarvam Bulbul v2 (speaker: vidya)&lt;/td&gt;
&lt;/tr&gt;
&lt;/tbody&gt;
&lt;/table&gt;&lt;/div&gt;


&lt;h2&gt;
  
  
  How It Works — The 3-Step Pipeline
&lt;/h2&gt;

&lt;p&gt;User speaks Hindi&lt;br&gt;
↓&lt;br&gt;
Sarvam STT (saarika:v2.5)&lt;br&gt;
→ Converts Hindi audio to text transcript&lt;br&gt;
↓&lt;br&gt;
Sarvam Chat (sarvam-30b)&lt;br&gt;
→ System prompt: "Answer in Hindi only, max 2-3 sentences"&lt;br&gt;
→ Generates Hindi reply&lt;br&gt;
↓&lt;br&gt;
Strip markdown + truncate to 490 characters&lt;br&gt;
↓&lt;br&gt;
Sarvam TTS (Bulbul v2, speaker: vidya)&lt;br&gt;
→ Converts Hindi text to audio&lt;br&gt;
→ Returns base64 encoded WAV&lt;br&gt;
↓&lt;br&gt;
App plays audio automatically&lt;/p&gt;

&lt;p&gt;All three API calls happen in one POST request to our &lt;br&gt;
backend &lt;code&gt;/process-voice&lt;/code&gt; endpoint. The entire round &lt;br&gt;
trip takes 8-12 seconds.&lt;/p&gt;


&lt;h2&gt;
  
  
  The Challenges We Actually Faced
&lt;/h2&gt;

&lt;p&gt;This is the part most hackathon posts skip. Here's &lt;br&gt;
what actually broke and how we fixed it.&lt;/p&gt;
&lt;h3&gt;
  
  
  1. node-fetch v3 broke our backend
&lt;/h3&gt;

&lt;p&gt;We installed &lt;code&gt;node-fetch&lt;/code&gt; normally and got a cryptic &lt;br&gt;
ES Module error. Turns out node-fetch v3 dropped &lt;br&gt;
CommonJS support. Fix: downgrade to v2.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npm &lt;span class="nb"&gt;install &lt;/span&gt;node-fetch@2
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Also had to add &lt;code&gt;"type": "commonjs"&lt;/code&gt; to package.json.&lt;/p&gt;

&lt;h3&gt;
  
  
  2. TTS API rejected long responses
&lt;/h3&gt;

&lt;p&gt;Sarvam's TTS API silently fails or errors when input &lt;br&gt;
exceeds 500 characters. The Chat API sometimes returns &lt;br&gt;
long markdown-formatted answers. Fix: strip markdown &lt;br&gt;
characters and truncate to 490 chars before every &lt;br&gt;
TTS call.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="nx"&gt;reply&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;reply&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="se"&gt;[&lt;/span&gt;&lt;span class="sr"&gt;#*_&lt;/span&gt;&lt;span class="se"&gt;\-&lt;/span&gt;&lt;span class="sr"&gt;&amp;gt;`&lt;/span&gt;&lt;span class="se"&gt;]&lt;/span&gt;&lt;span class="sr"&gt;/g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;""&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;replace&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="sr"&gt;/&lt;/span&gt;&lt;span class="se"&gt;\n&lt;/span&gt;&lt;span class="sr"&gt;+/g&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt; &lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
  &lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;trim&lt;/span&gt;&lt;span class="p"&gt;();&lt;/span&gt;

&lt;span class="k"&gt;if &lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;length&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="mi"&gt;490&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;reply&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;reply&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;substring&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;490&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  3. Render deployment needs process.env.PORT
&lt;/h3&gt;

&lt;p&gt;Our server had &lt;code&gt;const PORT = 3000&lt;/code&gt; hardcoded. Render &lt;br&gt;
assigns its own port via environment variable. Fix:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight javascript"&gt;&lt;code&gt;&lt;span class="kd"&gt;const&lt;/span&gt; &lt;span class="nx"&gt;PORT&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nx"&gt;process&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;env&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nx"&gt;PORT&lt;/span&gt; &lt;span class="o"&gt;||&lt;/span&gt; &lt;span class="mi"&gt;3000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="nx"&gt;app&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;listen&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nx"&gt;PORT&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="s2"&gt;0.0.0.0&lt;/span&gt;&lt;span class="dl"&gt;"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="p"&gt;()&lt;/span&gt; &lt;span class="o"&gt;=&amp;gt;&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nx"&gt;console&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="nf"&gt;log&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s2"&gt;`Server running on port &lt;/span&gt;&lt;span class="p"&gt;${&lt;/span&gt;&lt;span class="nx"&gt;PORT&lt;/span&gt;&lt;span class="p"&gt;}&lt;/span&gt;&lt;span class="s2"&gt;`&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;});&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h3&gt;
  
  
  4. Expo tunnel for remote testing
&lt;/h3&gt;

&lt;p&gt;The default Expo QR code only works on the same WiFi &lt;br&gt;
network. To test with our teammate on a different &lt;br&gt;
network we used:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;npx expo start &lt;span class="nt"&gt;--tunnel&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;






&lt;h2&gt;
  
  
  The Moment It Worked
&lt;/h2&gt;

&lt;p&gt;The first time a non-technical person used our app &lt;br&gt;
and asked "भारत में कितने राज्य हैं?" and heard &lt;br&gt;
the answer spoken back in Hindi — that was the moment &lt;br&gt;
we knew this was worth building.&lt;/p&gt;

&lt;p&gt;The app responded: "भारत में 28 राज्य हैं। &lt;br&gt;
इसके अतिरिक्त, 8 केंद्र शासित प्रदेश भी हैं।"&lt;/p&gt;

&lt;p&gt;Real answer. Real voice. Real Hindi.&lt;/p&gt;




&lt;h2&gt;
  
  
  What We Learned
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Sarvam AI is genuinely powerful for Indian languages.&lt;/strong&gt; 
The STT accuracy for Hindi was impressive even with 
casual conversational speech.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;Expo makes mobile development fast.&lt;/strong&gt; Going from 
zero to a working Android app in hours is remarkable.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The real work is in the edge cases.&lt;/strong&gt; Character 
limits, module systems, port configs — the actual 
coding challenge isn't the happy path, it's handling 
everything that breaks around it.&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  What's Next for This Project
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Support for 10+ Indian languages (Tamil, Telugu, Bengali)&lt;/li&gt;
&lt;li&gt;Offline mode for low-connectivity areas&lt;/li&gt;
&lt;li&gt;Domain-specific assistants for farming, health, education&lt;/li&gt;
&lt;li&gt;WhatsApp integration — no app install needed&lt;/li&gt;
&lt;/ul&gt;




&lt;h2&gt;
  
  
  Try It Yourself
&lt;/h2&gt;

&lt;p&gt;🎥 Demo Video: &lt;a href="https://youtube.com/shorts/Rt4l1aldhrg?feature=share" rel="noopener noreferrer"&gt;https://youtube.com/shorts/Rt4l1aldhrg?feature=share&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;💻 GitHub: &lt;a href="https://github.com/abhishek220205-hash/HackHazards-Voice-App" rel="noopener noreferrer"&gt;https://github.com/abhishek220205-hash/HackHazards-Voice-App&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Built with ❤️ by Team Victors for HackHazards 2026.&lt;br&gt;
Powered by Sarvam AI + Expo.&lt;/p&gt;

</description>
      <category>hackathon</category>
      <category>javascript</category>
      <category>reactnative</category>
      <category>ai</category>
    </item>
  </channel>
</rss>
