<?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[Picovoice - Medium]]></title>
        <description><![CDATA[Picovoice is the end-to-end platform for building voice products on your terms. Unlike Alexa and Google services, Picovoice runs entirely on-device while being more accurate. - Medium]]></description>
        <link>https://medium.com/picovoice?source=rss----860b548480a7---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>Picovoice - Medium</title>
            <link>https://medium.com/picovoice?source=rss----860b548480a7---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 19 Nov 2026 13:25:49 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/picovoice" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[Making a Podcast Transcription Server with Express.js]]></title>
            <link>https://medium.com/picovoice/making-a-podcast-transcription-server-with-express-js-e73861f10660?source=rss----860b548480a7---4</link>
            <guid isPermaLink="false">https://medium.com/p/e73861f10660</guid>
            <category><![CDATA[speech-recognition]]></category>
            <category><![CDATA[expressjs]]></category>
            <category><![CDATA[nodejs]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[podcast]]></category>
            <dc:creator><![CDATA[Ian Lavery]]></dc:creator>
            <pubDate>Thu, 19 May 2022 14:03:44 GMT</pubDate>
            <atom:updated>2023-03-30T19:14:08.691Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/680/1*m3Cru1FaxUX4Kt5ucRemmA.png" /></figure><p>I recently had this idea to create a server that transcribes content from an audio RSS feed. I’m a podcast lover (since at least 2006!) and on a few of my favourite, long-running shows they’ll frequently mention if a topic has come up on earlier shows, followed with “I wish we could search for this!”. In that moment, I can hear a late-night infomercial exclaiming “there’s got to be a better way!”. Of course, searching audio is a difficult task, but searching text is trivial. If we could just have a text-based equivalent for each podcast RSS, we could index it, do topic analysis on it, create summaries, etc.</p><p>These days, every great idea needs great software behind it. I was also looking to learn <a href="https://expressjs.com/">Express.js</a>, a popular framework for Node.js web apps. I chose this as my web framework because of its minimalist, performance-focused design. Also, all the cool kids are doing it.</p><p>Now, on to the transcription software. Picovoice recently released the <a href="https://picovoice.ai/platform/cat/">Leopard Speech-to-Text</a> engine which offers fully on-device audio transcription. Leopard will allow us to download new items from the RSS feed directly to our transcription server and process them there — eliminating any bandwidth and cloud costs associated with sending the audio to a cloud provider for processing.</p><p>With the tech sorted out, we can get to coding!</p><h3>Setting up a Server with Express.js</h3><p>Our general backend setup is going to be very simple. A single endpoint for transcription at /rss-transcribe that will accept an RSS URL and a general index page for testing:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a634d7ac72cbde4e8f2e4ff9159d6ec4/href">https://medium.com/media/a634d7ac72cbde4e8f2e4ff9159d6ec4/href</a></iframe><p>The test page will allow me to manually enter a podcast RSS feed URL and it will be sent to the /rss-transcribe backend for processing.</p><h3>Parsing the RSS Feed</h3><p>For those who don’t know an RSS feed is essentially just an XML file that’s hosted and updated periodically, usually representing some feed of context. For podcasts, each node contains metadata about the podcast and a link to the audio file. When our server gets the URL to the RSS feed it will need to fetch the XML file and then parse it in order to get the podcast episode entries. Luckily, there’s an npm for that!</p><p>For parsing, we’ll use a great RSS parser package from Robert Brennan called <a href="https://www.npmjs.com/package/rss-parser">rss-parser</a>. It’s going to take the URL and provide us with a JSON representation of the feed:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/d9b2f929a5d6d1d03ba954136396ced3/href">https://medium.com/media/d9b2f929a5d6d1d03ba954136396ced3/href</a></iframe><h3>Fetching the Audio</h3><p>Once I had the JSON of the RSS, I was able to find where the podcast audio link was located in the object. I tried a few different feeds and, in each of them, enclosure.url contained the link to the audio file. Initially, I tried a simple HTTP get on the URL, but I found that podcast audio links often redirect you multiple times, which can be difficult to handle. With the well-known request package axios used in place of HTTP get, this became a non-issue — I was able to get the audio file and write the mp3 to a temporary file for processing:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/e2f8751fc755a2cef2502b6bf14123c5/href">https://medium.com/media/e2f8751fc755a2cef2502b6bf14123c5/href</a></iframe><h3>Transcribing the Podcast</h3><p>Once we have the audio file, we can feed it to Picovoice’s Speech-to-Text engine, Leopard. In order to use Leopard, we need to sign up for a free <a href="https://console.picovoice.ai/login">Picovoice Console</a> account. Once signed in, we can get our AccessKey which will grant us free audio transcription as well!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*FhTcb3WZx-v0c2mEUUj8AA.gif" /></figure><p>Once we’ve copied our AccessKey, it’ll take only a couple of lines of code to get a transcription from our file, which we’ll send back in our response:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/0cb4a9d20705862b9679d48e16c8cbf9/href">https://medium.com/media/0cb4a9d20705862b9679d48e16c8cbf9/href</a></iframe><p>Where do we go from here?</p><p>Currently, in my test setup, I have the transcription being sent in the response, which I then write to a text file in the browser for download. This allowed me to try out the system end-to-end as a user, but it’s not exactly my dream of auto-transcribing an RSS feed and making a podcast searchable. So what pieces are missing?</p><p>For auto-transcribing an RSS feed, we’d need some sort of trigger that makes a call to our endpoint when a new podcast episode is posted. There’s some great tech for automating workflow like this. <a href="https://zapier.com/">Zapier</a>, for instance, has a trigger type that does exactly this! We could also implement our own trigger or just poll an RSS feed for updates.</p><p>For making it searchable, we just need to store and index the transcriptions we generate. Once we have that in place, we’d just need a front end with a search bar and a new endpoint for queries.</p><p>Something to work on for next time! In the meantime, check out <a href="https://github.com/Picovoice/leopard/tree/master/demo/expressjs">the source code</a> and feel free to add your own spin on it. For more information regarding Picovoice SDKs and products, visit the <a href="https://picovoice.ai/">website</a>, <a href="https://picovoice.ai/docs/">docs</a> or explore the <a href="https://github.com/Picovoice/">GitHub repositories</a>. If your project requires custom wake word or context models, sign up for the <a href="https://console.picovoice.ai/">Picovoice Console</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e73861f10660" width="1" height="1" alt=""><hr><p><a href="https://medium.com/picovoice/making-a-podcast-transcription-server-with-express-js-e73861f10660">Making a Podcast Transcription Server with Express.js</a> was originally published in <a href="https://medium.com/picovoice">Picovoice</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Implementing a lightweight transcription microservice with gRPC]]></title>
            <link>https://medium.com/picovoice/implementing-a-lightweight-transcription-microservice-with-grpc-edfcf750a084?source=rss----860b548480a7---4</link>
            <guid isPermaLink="false">https://medium.com/p/edfcf750a084</guid>
            <category><![CDATA[grpc]]></category>
            <category><![CDATA[go]]></category>
            <category><![CDATA[speech-recognition]]></category>
            <dc:creator><![CDATA[Mohammadreza Rostam]]></dc:creator>
            <pubDate>Fri, 29 Apr 2022 12:11:39 GMT</pubDate>
            <atom:updated>2023-03-30T19:13:33.680Z</atom:updated>
            <content:encoded><![CDATA[<p>Microservices have emerged as a trend in web application architecture, and there are some excellent motivations behind this tendency. Building your app as a set of microservices improves efficiency, portability, flexibility, and scalability. There are already a couple of fantastic articles on creating microservices using gRPC and Go (<a href="https://tutorialedge.net/golang/go-grpc-beginners-tutorial/">this</a> and <a href="https://medium.com/@amsokol.com/tutorial-how-to-develop-go-grpc-microservice-with-http-rest-endpoint-middleware-kubernetes-daebb36a97e9">this</a>). So instead, I would like to extend them here and focus on showing you how to create a lightweight speech-to-text (STT) microservice.</p><p>An ideal STT microservice should be snappy and small so that it can be created and destroyed on demand easily at a low cost. Picovoice recently released its offline Speech-To-Text engine, Leopard. It is fast and has a small memory footprint <a href="https://picovoice.ai/blog/speech-to-text-2-better-faster-stronger/">[Speech-to-Text 2.0]</a>. At the same time, its accuracy is comparable to the cloud-based services according to its <a href="https://picovoice.ai/docs/benchmark/stt/">open-source benchmark</a>. You only need to<a href="http://console.picovoice.ai/"> a Picovoice accoun</a>t for this project and use your <a href="https://picovoice.ai/pricing/">Free Plan</a> allowances. No credit card required.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/614/0*hMwM8h7_6Ri-I1ho" /><figcaption>Comparison of accuracy of Picovoice Speech-to-Text against leading cloud-based alternatives</figcaption></figure><p>To have a working gRPC microservice, three components are essential:</p><ol><li>A .proto file to define the gRPC services and messages</li><li>A server to process the submitted audio and returns back the transcription</li><li>A client to talk to the server</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*e9P9CFYqyRtGqs61VFwipw.png" /></figure><p><strong>.proto file:</strong></p><p>Let’s start with defining the interface in proto format:</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/ca0566fa8cf9417cda7c174214b0a894/href">https://medium.com/media/ca0566fa8cf9417cda7c174214b0a894/href</a></iframe><p>To keep everything simple, only one service (GetTranscriptionFile) is defined in the proto file. Since gRPC limits incoming messages to 4 MB by default, the type of the transcription service needs to be set to the client-side stream. This way, files are sent to the server in chunks of bytes.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/14980d9482998e10d421c9add0694e9b/href">https://medium.com/media/14980d9482998e10d421c9add0694e9b/href</a></iframe><p>The transcriptResponse message, which is sent back to the client, contains both inferred transcription and status code to tell the caller whether the call was successful.</p><p>Before we can import and use this service method in other files, we need to compile the .proto file with protoc as we are going to write both server and client in Go.</p><p><strong>Client:</strong></p><p>On the client-side, we need first to make a connection to the server and then create a client for the defined LeopardService service.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/a033507c3f46544edc37820041422a90/href">https://medium.com/media/a033507c3f46544edc37820041422a90/href</a></iframe><p>Inside the runsTranscriptFile function, the audio file is read in chunks of 1 MB and transmitted over to the server, and a timeout of 10 seconds is considered here. Finally, the stream is closed, and the server response is received by calling the CloseAndRecv function.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/de872359adc262beed7d9426d5a0c8f9/href">https://medium.com/media/de872359adc262beed7d9426d5a0c8f9/href</a></iframe><p><strong>Server:</strong></p><p>On the server-side, a gRPC service instance is defined and registered to answer to LeopardService calls.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/cd757a8da17e10e7237838946ea91b8e/href">https://medium.com/media/cd757a8da17e10e7237838946ea91b8e/href</a></iframe><p>Once a transcription request is received, the server starts an instance of the Leopard engine and keeps reading the shipped bytes until the EOF is received. After that, the bytes are stored as a temporary file and then passed to the leopard engine. Finally, the transcription is sent back to the client side along with a status code.</p><iframe src="" width="0" height="0" frameborder="0" scrolling="no"><a href="https://medium.com/media/c23c2da7cc62cbd7cd669b12fae7f8d2/href">https://medium.com/media/c23c2da7cc62cbd7cd669b12fae7f8d2/href</a></iframe><p>We could also have sent the audio in raw (pcm) format and directly fed it to the Leopard engine without storing it on the drive, but there are two caveats. First, more preprocessing work would have to be done on the client-side to decode the audio file. Second, the amount of data needed to be transferred for the raw format is significantly more than compressed formats like MP3 or OGG.</p><p>That’s all! Now you just need to run the server and client with proper input arguments.</p><p>The source code of this demo can be found on <a href="https://github.com/Picovoice/leopard/tree/master/demo/go-grpc">Leopard GitHub Repository</a>. It can serve as a template or a starting point and be tailored to meet individual requirements. For instance, if you want to transcribe an audio file that is already on the internet, you can modify the demo and send a simple URL to the server instead of the entire file. Please refer to the <a href="https://github.com/Picovoice/leopard/blob/master/demo/go-grpc/readme.md">readme.md</a> to run the demo and see it in practice. To know more about the Leopard Go APIs, take a look at <a href="https://picovoice.ai/docs/api/leopard-go/">Leopard Docs Page</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=edfcf750a084" width="1" height="1" alt=""><hr><p><a href="https://medium.com/picovoice/implementing-a-lightweight-transcription-microservice-with-grpc-edfcf750a084">Implementing a lightweight transcription microservice with gRPC</a> was originally published in <a href="https://medium.com/picovoice">Picovoice</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Serverless Speech-to-Text]]></title>
            <link>https://medium.com/picovoice/serverless-speech-to-text-5258e05f7031?source=rss----860b548480a7---4</link>
            <guid isPermaLink="false">https://medium.com/p/5258e05f7031</guid>
            <category><![CDATA[serverless]]></category>
            <category><![CDATA[aws-lambda]]></category>
            <category><![CDATA[api-gateway]]></category>
            <category><![CDATA[voice-assistant]]></category>
            <category><![CDATA[speech-recognition]]></category>
            <dc:creator><![CDATA[Kyeo]]></dc:creator>
            <pubDate>Wed, 13 Apr 2022 04:10:20 GMT</pubDate>
            <atom:updated>2022-07-23T14:41:08.342Z</atom:updated>
            <content:encoded><![CDATA[<p>Speech recognition is expensive because it requires large servers, specialized hardware (e.g. GPU), and dedicated ops teams to maintain the infrastructure. Serverless computing (e.g. AWS Lambda) can solve these problems. Alas, existing ASR engines are too hefty to run within a Lambda function.</p><p>We at Picovoice recently released a speech-to-text engine called <a href="https://picovoice.ai/platform/cat/">Leopard</a>. It only takes 20 MB of storage and can run even on tiny embedded processors like Raspberry Pi. Why not run it on AWS Lambda to make speech recognition much more affordable? <strong>I show you how to run Leopard on AWS Lambda with less than 0.01 USD per hour while cloud providers charge well above 1 USD per hour.</strong></p><h3>Accuracy</h3><p>Leopard’s accuracy is competitive with Amazon Transcribe and Google Speech-to-Text. Benchmark’s code and data are <a href="https://github.com/Picovoice/speech-to-text-benchmark">here</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/1*vADg7qV5whke_abq3hABLQ.png" /><figcaption>WER benchmark</figcaption></figure><h3>Architecture Overview</h3><figure><img alt="" src="https://cdn-images-1.medium.com/max/671/1*EiVyUQIlP3FoT_d_1pETdg.png" /><figcaption>Serverless speech-to-text components</figcaption></figure><h3>Pre-requisites</h3><ol><li>Register for an <a href="https://aws.amazon.com/account/">AWS</a> account. We use it to access Amazon Lambda and API Gateway services via the console.</li><li>Sign up for <a href="https://console.picovoice.ai/">Picovoice Console</a> to get your AccessKey for free. We will need an AccessKey to use Leopard Speech-to-Text engine.</li><li>Download <a href="https://www.postman.com/downloads/">Postman</a>. We will use this tool for testing.</li></ol><h3>Setting up Lambda</h3><p>1. In AWS Console search forLambda and then go to the Functions tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/619/1*laXggdPuQwTpxixFP6zaag.png" /></figure><p>2. Press Create a Function. Then set the function name and set the runtime to Python 3.9.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uC8A7kVnlDc0FbIIKQ0wtg.gif" /></figure><p>3. Download the zip file from the <a href="https://github.com/Picovoice/serverless-leopard/blob/main/serverless_leopard.zip">GitHub repository</a> which contains the Lambda handler (<a href="https://github.com/Picovoice/serverless-leopard/blob/main/serverless_leopard/lambda_function.py">source</a>) and packaged <a href="https://pypi.org/project/pvleopard/">pvleopard module</a>.</p><p>The Lambda handler does the following:</p><ol><li>Gets and parses the data from the request.</li><li>Saves the audio data into a temporary file.</li><li>Transcribes and cleans up the temporary file.</li><li>Returns the transcription.</li></ol><p>4. Press on Upload from &gt; .zip file and upload the zip file.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*y5Xb-NjjewiYIk_5Xm403w.gif" /></figure><p>5. Once the function is uploaded, go to Configurations &gt; General configuration tab. Press on Edit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*TmgXz-_g5uTYRFE5iGyyuQ.png" /></figure><p>6. Set the memory limit to 512 MB and timeout to 30 seconds and press Save.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/817/1*B_dPjp2EU4n7mlzpzGZRFA.png" /></figure><p>7. Go to Environment variables tab and press on Edit.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sRIig5us6dtMxJwdh199Hw.png" /></figure><p>8. Add your AccessKey that you obtained from <a href="https://console.picovoice.ai/">Picovoice Console</a> and press Save.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/819/1*MGNiaFlV3xjjHbH57Utb0Q.png" /></figure><p>9. Press on Copy ARN (button located in the top right corner) and save your function ARN. We will need to set up API Gateway later. You may also come back later to copy your function ARN.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GazD8ySApGnWMrviw-MWwA.png" /></figure><h3>Setting up API Gateway</h3><p>1. In AWS Console, go to API Gateway, and go to REST API section. Press on Build to create a new Rest API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*l2U8B957gb4YHw1V8q3hKw.png" /></figure><p>2. Select Rest as the protocol, New API, and give a name to your API. Press Create API to create your API.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/835/1*ZeQLgKcHrxRetpyF9VDB-A.png" /></figure><p>3. Press Actions &gt; Create Method and select POST as your method. Select Lambda Function as the integration type, tick on Proxy Integration, and copy your Lambda function ARN saved from before.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*i6tfH35EHW67YTDp45AUSw.gif" /></figure><p>4. Once created, go to Settings tab.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/225/1*blTUy4Y6Yh-N3NCEoohaiQ.png" /></figure><p>5. Scroll all the way down. In Binary Media Types press on Add Binary Media Type, add multipart/form-data and press on Save Changes.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*N22w2Ojh6wQLGfDVUy47bg.gif" /></figure><p>6. Go back to Resources tab. Press on Actions &gt; Deploy API. Set [New Stage] as the deployment stage, give it a stage name and press Deploy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Z5a3D1Iw209BqcWq1y7tQA.gif" /></figure><p>You will be redirected to Stages and your API URL will be shown. Now we can test our rest API.</p><h3>Testing the API</h3><p>We will use <a href="https://www.postman.com/downloads/">Postman</a> to send an audio file and get the transcription.</p><p>1. Copy and paste the invoke URL from API Gateway in the request URL section and set the request type to POST.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DuFD1OejLZUWxIFpmWMB2Q.png" /></figure><p>2. In the Body tab, set the data type to form-data. Set the key name to audio_file, set the type as File, and press on Select Files and select the audio file you want to transcribe (Leopard supports the following audio formats: FLAC, MP3, Ogg, Opus, Vorbis, WAV, and WebM).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*DX_BgBFYFGV-vXukqMTRqA.gif" /></figure><p>3. Once the request goes through, the result will show below.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/702/1*y9EVZFvPhvjePXY8Bx7JYQ.png" /></figure><p>In AWS Console, go to CloudWatch &gt; Log groups if you would like more details on a specific API request and Lambda invocation.</p><h3>Cost Estimation</h3><p>We like to estimate how much it costs to process one hour of audio using this architecture. We assume that we are processing uniform 15-second files for simplification. This means that every 240 API calls are worth an hour of audio. The prices are estimated with costs taken from <a href="https://aws.amazon.com/api-gateway/pricing/">API Gateway pricing page</a> and <a href="https://aws.amazon.com/lambda/pricing/">Lambda pricing page</a> in the us-west-2 region.</p><h4>API Gateway Cost</h4><pre>240 requests * 3.5$/million = 0.00084$ / hour</pre><h4>Lambda Request Cost</h4><pre>240 requests * 0.2$/million = 0.00005$ / hour</pre><h4>Lambda Compute Cost</h4><p>A 15-second audio file takes around 3000ms to execute. With 512MB of memory size, the total compute cost is:</p><pre>240 request * 3 seconds = 720 seconds<br>0.5GB * 720 seconds = 360 GB-seconds<br>360GB-seconds * 0.0000166667$ = 0.006$ / hour</pre><p><strong>Total costs per hour</strong>: 0.00084 + 0.00005 + 0.006 = 0.00689$.</p><h4>Comparison with other Speech-to-Text services</h4><p>We compare costs with <a href="https://cloud.google.com/speech-to-text/pricing">Google Cloud STT</a> and <a href="https://aws.amazon.com/transcribe/pricing/">AWS Transcribe</a> with the same setup as before.</p><pre>Google Cloud STT: 240 files * 0.006$ = 1.44$ / hour</pre><pre>AWS Transcribe: (240 files * 15 seconds) / 0.024$ = 1.44$ / hour</pre><p>In this setup, the price of serverless speech-to-text is noticeably cheaper than using existing services.</p><h3>Limitations &amp; Future Explorations</h3><p>API Gateway has a 29-second timeout and 10MB payload size limit. Lambda has a 15-minute timeout and a 6MB payload size limit.</p><p>Hence, the audio size must be less than 4.5MB (the audio file is base64 encoded) and less than 2 minutes to transcribe successfully before a timeout occurs.</p><p>In this article, we focused on how to set up Leopard to perform short audio transcription. But one may try some solutions to go past these limitations:</p><ul><li>To transcribe audio files larger than 4.5MB, use <a href="https://docs.aws.amazon.com/AmazonS3/latest/userguide/PresignedUrlUploadObject.html">S3</a> to get a pre-signed upload URL, upload your audio file, fetch it in Lambda, and process it.</li><li>To transcribe audio files greater than 2 minutes (longer processing time), use <a href="https://docs.aws.amazon.com/lambda/latest/dg/invocation-async.html">Asynchronous Lambda</a> to ping and get the response when the transcription finishes.</li></ul><h3>Conclusion</h3><p>We have seen how to set up Leopard and integrate it with Lambda and API Gateway. Keep in mind this setup is for smaller audio files that require transcription. Since this is a starter code, you can always modify the <a href="https://github.com/Picovoice/serverless-leopard">code</a>, re-zip, and upload the zip file again to update your function.</p><p>Take a look at <a href="https://github.com/Picovoice/leopard">Leopard GitHub Repository</a> or <a href="https://picovoice.ai/docs/leopard/">Leopard Docs Page</a> to learn more about Leopard.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=5258e05f7031" width="1" height="1" alt=""><hr><p><a href="https://medium.com/picovoice/serverless-speech-to-text-5258e05f7031">Serverless Speech-to-Text</a> was originally published in <a href="https://medium.com/picovoice">Picovoice</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[.NET Speech-To-Text on the Edge]]></title>
            <link>https://medium.com/picovoice/net-speech-to-text-on-the-edge-d503e2a8aab2?source=rss----860b548480a7---4</link>
            <guid isPermaLink="false">https://medium.com/p/d503e2a8aab2</guid>
            <category><![CDATA[edge]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[dotnet]]></category>
            <category><![CDATA[csharp]]></category>
            <category><![CDATA[speech-recognition]]></category>
            <dc:creator><![CDATA[Ian Lavery]]></dc:creator>
            <pubDate>Wed, 06 Apr 2022 13:35:09 GMT</pubDate>
            <atom:updated>2023-03-30T19:11:42.091Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*T30C35G2p-w5Yk9jiYpDog.png" /></figure><p>Modern audio transcription is moving off the cloud and back to the device. For developers, this means no roundtrip data transfers — decreasing bandwidth usage, computation costs, and latency. For users, this means better privacy and security.</p><p>Historically, there’s been several roadblocks to getting speech-to-text to the edge: language model size, platform support, and cumbersome APIs have been just some of the obstacles. Fortunately, with the recently released Picovoice <a href="https://picovoice.ai/platform/cat/">Leopard Speech-to-Text</a> SDK for cross-platform .NET, the road is clear and it’s time to get coding!</p><h4>1- Install Leopard NuGet Package</h4><p>Install Leopard with the NuGet package browser or with the nifty dotnet CLI:</p><pre>dotnet add package Leopard</pre><h4>2- Get a Picovoice AccessKey</h4><p>Sign up for <a href="https://console.picovoice.ai/">Picovoice Console</a> using an email or your GitHub account and grab your free AccessKey. Picovoice’s <a href="https://picovoice.ai/pricing/">Free Plan</a> includes free transcription with Leopard. No credit card required.</p><h4>3- Code</h4><p>In your .NET project, create an instance of Leopard:</p><pre>using Pv;</pre><pre>string accessKey = &quot;${ACCESS_KEY}&quot;<br>Leopard leopard = Leopard.Create(accessKey);</pre><p>You can pass an audio file to Leopard or record audio and pass in the raw data. In this example we pass in an array of data from our microphone:</p><pre>short[] audio = //.. audio obtained from microphone<br>string transcript = leopard.Process(audio);</pre><p>Here is a basic .NET console app in action:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sFfUCpsmMBUk5Dc3_IjONQ.gif" /><figcaption>Leopard detects “Testing 1 2 3”</figcaption></figure><p>Check out the full source code <a href="https://github.com/Picovoice/leopard/tree/master/demo/dotnet">here</a>!</p><h4>4- Resources</h4><ul><li><a href="https://github.com/Picovoice/leopard">Leopard GitHub repository</a></li><li><a href="https://github.com/Picovoice/speech-to-text-benchmark">Speech-to-Text Benchmark GitHub Repository</a></li><li><a href="https://console.picovoice.ai/">Picovoice Console</a></li><li><a href="https://picovoice.ai/platform/cat/">Picovoice Website</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d503e2a8aab2" width="1" height="1" alt=""><hr><p><a href="https://medium.com/picovoice/net-speech-to-text-on-the-edge-d503e2a8aab2">.NET Speech-To-Text on the Edge</a> was originally published in <a href="https://medium.com/picovoice">Picovoice</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Transcribe Speech to Text with Python for Free]]></title>
            <link>https://medium.com/picovoice/transcribe-speech-to-text-with-python-for-free-321b063b213c?source=rss----860b548480a7---4</link>
            <guid isPermaLink="false">https://medium.com/p/321b063b213c</guid>
            <category><![CDATA[voice-recognition]]></category>
            <category><![CDATA[transcription]]></category>
            <category><![CDATA[voice-assistant]]></category>
            <category><![CDATA[edge-computing]]></category>
            <category><![CDATA[speech-recognition]]></category>
            <dc:creator><![CDATA[Alireza Kenarsari]]></dc:creator>
            <pubDate>Wed, 30 Mar 2022 03:41:47 GMT</pubDate>
            <atom:updated>2023-03-30T19:03:47.579Z</atom:updated>
            <content:encoded><![CDATA[<p>Amazon Transcribe, Google Speech-to-Text, Azure Cognitive Services, IBM Watson, AssemblyAI, DeepGram, Speechmatics, and Rev, … all provide APIs to transcribe audio files. You should give <a href="https://picovoice.ai/platform/cat/">Picovoice Leopard</a> a try not only because it offers free transcription but also because it is:</p><ul><li>Private — All voice processing runs locally</li><li>Accurate [<a href="https://picovoice.ai/docs/benchmark/stt/">1</a>]</li><li>Compact and Computationally Efficient <a href="https://github.com/Picovoice/speech-to-text-benchmark#rtf">[2]</a></li><li>Cross-Platform — Runs on Linux, macOS, Windows, Android, iOS, Raspberry Pi, and NVIDIA Jetson</li></ul><p>You can get started with 3 lines of code!</p><h3>1- Install</h3><p>Install Leopard from a terminal:</p><pre>pip3 install pvleoparddemo</pre><h3>2- Try it</h3><p>Sign up for <a href="https://console.picovoice.ai/">Picovoice Console</a> using GitHub (or email) and grab your free AccessKey (no credit card required)<em>:</em></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/979/1*oCB7AWXIhCZrgec5nWtbGA.gif" /><figcaption>Picovoice Console</figcaption></figure><p>Run the microphone demo from the terminal:</p><pre>leopard_demo_mic --access_key ${YOUR_ACCESS_KEY}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/816/1*wWW8nCnao_orv5TDwqnOIQ.gif" /><figcaption>Leopard Microphone Demo</figcaption></figure><h3>3- Build</h3><p>Create an instance of Leopard:</p><pre>from pvleopard import *</pre><pre><br>o = create(access_key=${YOUR_ACCESS_KEY})</pre><p>Transcribe an audio file:</p><pre>transcript, words = o.process_file(${YOUR_AUDIO_FILE_PATH})<br>print(transcript)</pre><h3>4- Resources</h3><ul><li><a href="https://github.com/Picovoice/leopard">Leopard GitHub repository</a></li><li><a href="https://github.com/Picovoice/speech-to-text-benchmark">Speech-to-Text Benchmark GitHub Repository</a></li><li><a href="https://console.picovoice.ai/">Picovoice Console</a></li><li><a href="https://picovoice.ai/platform/cat/">Picovoice Website</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=321b063b213c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/picovoice/transcribe-speech-to-text-with-python-for-free-321b063b213c">Transcribe Speech to Text with Python for Free</a> was originally published in <a href="https://medium.com/picovoice">Picovoice</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[20 MB is all you need for speech-to-text]]></title>
            <link>https://medium.com/picovoice/20-mb-is-all-you-need-for-speech-to-text-7e701b7f6bfc?source=rss----860b548480a7---4</link>
            <guid isPermaLink="false">https://medium.com/p/7e701b7f6bfc</guid>
            <category><![CDATA[tinyml]]></category>
            <category><![CDATA[rsa]]></category>
            <category><![CDATA[voice-assistant]]></category>
            <category><![CDATA[voice-recognition]]></category>
            <category><![CDATA[speech-recognition]]></category>
            <dc:creator><![CDATA[Alireza Kenarsari]]></dc:creator>
            <pubDate>Tue, 08 Mar 2022 05:10:35 GMT</pubDate>
            <atom:updated>2023-03-30T19:04:30.458Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/980/1*QH1MQQPtJXuBurHm20EfWw.jpeg" /></figure><p>Speech-to-Text is a technology that automatically converts human speech into text. Hence, it is also known as automatic speech recognition or ASR. It is a crucial piece of technology. The amount of available spoken data is growing exponentially. The first step towards generating any value from it is transcribing it. The rest of this post is about speech-to-text engines and why I thought it’s a good idea to create one more in 2022!</p><h3>Where are we?</h3><ul><li>Existing competitive engines are too big and slow to run on commodity hardware and hence are either cloud-based or on-premise.</li><li>Motivated by cost savings, Google, Amazon, and Apple started pushing their speech-to-text engines closer to where data resides. But only for their first-party products (i.e. Google Pixel, Amazon Echo, and iPhone).</li><li>Third parties that don’t have Google-like resources are stuck with cloud-based or on-prem offerings.</li></ul><h3><strong>Why another speech-to-text engine?</strong></h3><p>The current paradigm of sending audio data to someone else’s cloud infrastructure is expensive. The high cost is an inherent limitation as bandwidth and dedicated cloud-compute are costly. Also, cloud computing doesn’t help with privacy or latency. If you want to keep it private and fast, you need to bring algorithms closer to the data.</p><h3>Introducing Leopard</h3><p><a href="https://picovoice.ai/platform/cat/">Leopard</a> is the speech-to-text engine we’ve built at Picovoice.</p><ul><li>It performs all voice processing on-device. It is 20 MB in size and runs on virtually anything.</li><li>It matches cloud-level accuracy (see benchmark section below).</li><li>It is at least 10x more cost-effective than alternatives</li><li>It allows adding custom vocabulary so that your model understands what matters to you the most.</li></ul><h3>Where to go from here?</h3><p>Start building for free! No credit card is required.</p><ul><li><a href="https://picovoice.ai/docs/">Docs</a>.</li><li><a href="https://github.com/Picovoice/leopard">GitHub</a>.</li><li>Platforms: Web, Linux, macOS, Windows, Android, iOS, Raspberry Pi, NVIDIA Jetson Nano</li><li>SDKs: <a href="https://picovoice.ai/docs/quick-start/leopard-c/">C</a>, <a href="https://picovoice.ai/docs/quick-start/leopard-python/">Python</a>, <a href="https://picovoice.ai/docs/quick-start/leopard-nodejs/">Node.js</a>, <a href="https://picovoice.ai/docs/quick-start/leopard-dotnet/">.NET</a>, <a href="https://picovoice.ai/docs/quick-start/leopard-java/">Java</a>, <a href="https://github.com/Picovoice/leopard/tree/master/binding/go">Go</a>, <a href="https://picovoice.ai/docs/quick-start/leopard-ios/">iOS</a>, <a href="https://picovoice.ai/docs/quick-start/leopard-android/">Android</a>, <a href="https://picovoice.ai/docs/quick-start/leopard-flutter/">Flutter</a>, <a href="https://picovoice.ai/docs/quick-start/leopard-react-native/">React Native</a>, <a href="https://picovoice.ai/docs/quick-start/leopard-web/">Web</a></li></ul><h3>Open-Source Benchmark</h3><h4>Word Error Rate (WER)</h4><p>The accuracy of Leopard is benchmarked against major cloud providers (Google, Amazon, Microsoft, and IBM). Mozilla’s DeepSpeech as an on-device alternative is also included. The benchmark is the average of <a href="https://www.openslr.org/12">LibriSpeech</a>, <a href="https://commonvoice.mozilla.org/en">CommonVoice</a>, and <a href="https://www.openslr.org/51/">TED talks</a>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*Q2HAroi-et-kL0ZRLlNRIA.png" /><figcaption>Word error rate (WER) benchmark. Mozilla DeepSpeech, IBM Watson, Google Speech-to-Text, Picovoice Leopard, Amazon Transcribe, and Azure Cognitive Services.</figcaption></figure><h4>Runtime</h4><p>We also have included runtime metrics for both DeepSpeech and Leopard. Leopard is 60x smaller and 9x faster.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*1kHA4PE0EQ22mcUvykUCAQ.png" /><figcaption>CPU and memory usage. Picovoice Leopard vs Mozilla DeepSpeech. Leopard archives 11% WER and Mozilla DeepSpeech is at 22.86%.</figcaption></figure><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7e701b7f6bfc" width="1" height="1" alt=""><hr><p><a href="https://medium.com/picovoice/20-mb-is-all-you-need-for-speech-to-text-7e701b7f6bfc">20 MB is all you need for speech-to-text</a> was originally published in <a href="https://medium.com/picovoice">Picovoice</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[OctoTube: Voice Search for YouTube]]></title>
            <link>https://medium.com/picovoice/octotube-voice-search-for-youtube-eddc375873a1?source=rss----860b548480a7---4</link>
            <guid isPermaLink="false">https://medium.com/p/eddc375873a1</guid>
            <category><![CDATA[youtube]]></category>
            <category><![CDATA[transcription]]></category>
            <category><![CDATA[search]]></category>
            <category><![CDATA[voice-search]]></category>
            <category><![CDATA[voice-recognition]]></category>
            <dc:creator><![CDATA[Alireza Kenarsari]]></dc:creator>
            <pubDate>Tue, 02 Nov 2021 15:18:06 GMT</pubDate>
            <atom:updated>2022-09-02T14:28:11.821Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*XMOCywD57ylXRu3lEDMVjw.png" /></figure><p>Have you ever been in a situation where you are going back and forth in a YouTube video searching for a specific phrase? No more. There is a little script that can search any video (even without transcription) lightning-fast and point you to the exact second the phrase occurs. Enter OctoTube!</p><h3>Get Started</h3><p>Clone the Octopus GitHub repository:</p><pre>git clone --recurse-submodules https://github.com/Picovoice/octopus.git</pre><p>Run this from the root of the repository to install Python dependencies:</p><pre>pip3 install -r demo/youtube/requirements.txt</pre><p>Get an AccessKey from <a href="https://console.picovoice.ai/">Picovoice Console</a>. It is free.</p><p>Find a video on YouTube you like to search and from the root of the repository run:</p><pre>python3 demo/youtube/octotube.py \<br>--access-key ${ACCESS_KEY} \<br>--url ${YOUTUBE_VIDEO_URL} \<br>--phrases ${SEARCH_PHRASE0} ${SEARCH_PHRASE1}</pre><p>You should get something like the below (yes, I watch too much <a href="https://en.wikipedia.org/wiki/Silicon_Valley_(TV_series)">Silicon Valley</a>):</p><pre>indexed 3024 seconds of audio in 54.36 seconds</pre><pre>searched 3024 seconds of audio for 1 phrases in 0.01013 seconds</pre><pre>pied piper &gt;&gt;&gt;</pre><pre>[0.5] https://www.youtube.com/watch?v=Lt6PPiTTwbE&amp;t=784</pre><pre>[1.0] https://www.youtube.com/watch?v=Lt6PPiTTwbE&amp;t=840</pre><pre>[1.0] https://www.youtube.com/watch?v=Lt6PPiTTwbE&amp;t=2355</pre><pre>[1.0] https://www.youtube.com/watch?v=Lt6PPiTTwbE&amp;t=2940</pre><p>Notice that indexing is the bulk of the processing time. The good news is once the video is indexed, it is super fast to search for more (similar to how the Google search engine works):</p><pre>searched 3024 seconds of audio for 1 phrases in 0.00655 seconds</pre><pre>jian yang &gt;&gt;&gt;</pre><pre>[0.3] https://www.youtube.com/watch?v=Lt6PPiTTwbE&amp;t=1332</pre><pre>[0.7] https://www.youtube.com/watch?v=Lt6PPiTTwbE&amp;t=2478</pre><h3>How Does it Work?</h3><p>OctoTube uses the Picovoice Speech-to-Index engine (also known as <a href="https://picovoice.ai/platform/octopus/">Octopus</a>). Octopus directly indexes audio without relying on a text representation (<a href="https://picovoice.ai/blog/direct-speech-indexing/">Learn more</a>). Octopus runs on Android, iOS, Ubuntu, macOS, Windows, and even modern web browsers.</p><h3>Start Building</h3><p>Go to Octopus’s <a href="https://github.com/Picovoice/octopus">GitHub</a> and start building your applications with Octopus!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=eddc375873a1" width="1" height="1" alt=""><hr><p><a href="https://medium.com/picovoice/octotube-voice-search-for-youtube-eddc375873a1">OctoTube: Voice Search for YouTube</a> was originally published in <a href="https://medium.com/picovoice">Picovoice</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Yet Another Voice Activity Detection Engine]]></title>
            <link>https://medium.com/picovoice/yet-another-voice-activity-detection-engine-7a2e5dfb3825?source=rss----860b548480a7---4</link>
            <guid isPermaLink="false">https://medium.com/p/7a2e5dfb3825</guid>
            <category><![CDATA[vui]]></category>
            <category><![CDATA[vad]]></category>
            <category><![CDATA[speech-recognition]]></category>
            <category><![CDATA[voice-recognition]]></category>
            <dc:creator><![CDATA[Alireza Kenarsari]]></dc:creator>
            <pubDate>Wed, 27 Oct 2021 01:49:21 GMT</pubDate>
            <atom:updated>2022-09-02T14:23:36.594Z</atom:updated>
            <content:encoded><![CDATA[<p>Voice activity detection (VAD) is a tiny algorithm that monitors a stream of audio for human speech.</p><h3>Enter Cobra!</h3><p><a href="https://picovoice.ai/platform/cobra/">Cobra</a> is Picovoice’s VAD engine. Cobra is:</p><ul><li>Cross-platform (Raspberry Pi, NVIDIA Jetson, Android, iOS, Web, Linux, macOS, Windows, …)</li><li>Efficient (Runs on Raspberry Pi Zero with 5% CPU usage)</li><li>Accurate even in harsh noisy environments</li><li>Available on <a href="https://github.com/Picovoice/cobra"><strong>GitHub</strong></a> and free for developers to explore!</li></ul><h3>Web Demo</h3><p>Try Cobra’s WebAssembly SDK live <a href="https://picovoice.ai/demos/cobra/">here</a>!</p><h3>Python Demo</h3><p>Install the demo package:</p><pre>pip3 install pvcobrademo</pre><p>Go to <a href="https://console.picovoice.ai/"><strong>Picovoice Console</strong></a>, sign up for a free account, create your <em>AccessKey</em>, and run the demo:</p><pre>cobra_demo_mic --access_key ${YOUR_ACCESS_KEY}</pre><h3>Benchmark</h3><p><a href="https://webrtc.org/">WebRTC</a> has an excellent VAD that also comes with <a href="https://github.com/wiseman/py-webrtcvad">Python binding</a>. We created an <a href="https://github.com/Picovoice/voice-activity-benchmark"><strong>open-source benchmark</strong></a> comparing Cobra to alternatives. The picture below shows a so-called <a href="https://en.wikipedia.org/wiki/Receiver_operating_characteristic#:~:text=A%20receiver%20operating%20characteristic%20curve,which%20led%20to%20its%20name.">ROC curve</a>. The higher the area under the curve, the better. For example, one can see that Cobra achieves 90+% accuracy (true positive) at a 5-% false alarm rate while WebRTC is just below 50%.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/640/1*0PFE_3bmXLMen2hb7fznmw.png" /></figure><h3>Next Steps</h3><p>Head to <a href="https://github.com/Picovoice/cobra"><strong>GitHub</strong></a> and start building with Cobra!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=7a2e5dfb3825" width="1" height="1" alt=""><hr><p><a href="https://medium.com/picovoice/yet-another-voice-activity-detection-engine-7a2e5dfb3825">Yet Another Voice Activity Detection Engine</a> was originally published in <a href="https://medium.com/picovoice">Picovoice</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Offline Voice AI on Arduino]]></title>
            <link>https://medium.com/picovoice/offline-voice-ai-on-arduino-4a7f7e572bfb?source=rss----860b548480a7---4</link>
            <guid isPermaLink="false">https://medium.com/p/4a7f7e572bfb</guid>
            <dc:creator><![CDATA[Mohammadreza Rostam]]></dc:creator>
            <pubDate>Mon, 14 Jun 2021 21:39:05 GMT</pubDate>
            <atom:updated>2023-02-12T15:09:36.807Z</atom:updated>
            <content:encoded><![CDATA[<p>Did you know it’s now possible to perform high-accuracy speech recognition on a microcontroller? Advances in machine learning have brought voice capability to these extremely resource-constrained devices, via the Picovoice SDK. Arduino recently joined the list of supported devices, starting with the <a href="https://store.arduino.cc/usa/nano-33-ble-sense">Arduino Nano 33 BLE Sense</a>. We’re going to add a voice assistant loop to this board and demonstrate how you can easily customize it to make your Arduino understand naturally-spoken phrases of your own design.</p><p>The <a href="https://picovoice.ai/docs/picovoice/">Picovoice SDK</a> is able to infer a user’s intent from a naturally spoken utterance such as:</p><blockquote><em>“Picovoice, make the blue light blink ten times quickly.”</em></blockquote><p>Picovoice detects the wake word (“<strong>Picovoice”</strong>), then determines the intent from the follow-on spoken command (“make the blue lights blink ten times quickly”):</p><pre>{ <br> “intent”: “blinkLight”, <br> “slots”: {  <br>  “color”: “blue”<br>  “Iteration”: “10”<br>  “speed”: “quickly”<br> }<br>}</pre><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*IY56TXM6wmBj-Tgc" /><figcaption>Arduino Nano 33 BLE Sense</figcaption></figure><p>Let’s start with a demo project that controls the Arduino’s on-board LEDs, using voice commands.</p><p>I have shared the source code <a href="https://create.arduino.cc/editor/dynamix91/7dae06f6-b827-4b20-ad00-b1558ae1b98c/preview">here</a>, so you can try it yourself:</p><ol><li>Download the <a href="https://create.arduino.cc/editor/dynamix91/7dae06f6-b827-4b20-ad00-b1558ae1b98c/preview">project</a> (both Control_LED_Picovoice.in and param.h).</li><li>Open the<a href="https://www.arduino.cc/en/guide/libraries"> Library Manager</a> in the Arduino IDE, search for the Picovoice package, and click on the Install button.</li><li>Sign up for <a href="https://console.picovoice.ai/">Picovoice Console</a> to get your AccessKey for free. We will need an AccessKey to use the Picovoice package.</li><li>Open the downloaded sketch, and replace the placeholder with your AccessKey:</li></ol><pre>static const char* ACCESS_KEY = &quot;${YOUR_ACCESSKEY}&quot;; // AccessKey string obtained from Picovoice Console (https://picovoice.ai/console/)</pre><ol><li>Upload it into the board.</li><li>Open the serial monitor. You will see the grammar for the context, describing all of the follow-on voice commands it understands.</li><li>Say, for example:</li></ol><blockquote>“Picovoice, make red flash”</blockquote><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2Fb7wzFEDU0U8%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3Db7wzFEDU0U8&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2Fb7wzFEDU0U8%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/62ac8f15c5e1804e9c568cdba5518805/href">https://medium.com/media/62ac8f15c5e1804e9c568cdba5518805/href</a></iframe><h3>Build your own Sketch</h3><p><strong>Create a custom context model</strong></p><p>Go to<a href="http://picovoice.ai/console/"> Picovoice Console</a>, an online tool for easily designing and training models for voice interactions that run on the Picovoice SDK. I suggest watching <a href="https://www.youtube.com/watch?v=npBaOx30QUs&amp;t=19s">this video tutorial</a> or reading <a href="https://picovoice.ai/docs/rhino/">this guide</a> if you want to learn more.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/800/0*E7iFXpD9JybQ0N2o" /><figcaption>Context Editor</figcaption></figure><p><strong>Add the context model to a project</strong></p><ol><li>Replace CONTEXT_ARRAY in the param.h file with the new context model by following the steps explained in the <a href="https://picovoice.ai/docs/quick-start/picovoice-arduino/">Picovoice SDK for Arduino documentation</a>.</li><li>Update the inference_callback so that it takes appropriate actions (e.g., blinking a LED) once an intent is recognized.</li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/576/0*SESIS4gbp8ptTWZM" /><figcaption>The logic inside the inference_callback function to address several intents with different slots.</figcaption></figure><p>Learn more about working with the Picovoice SDK for Arduino by visiting the <a href="https://picovoice.ai/docs/api/picovoice-microcontroller/">documentation</a>.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=4a7f7e572bfb" width="1" height="1" alt=""><hr><p><a href="https://medium.com/picovoice/offline-voice-ai-on-arduino-4a7f7e572bfb">Offline Voice AI on Arduino</a> was originally published in <a href="https://medium.com/picovoice">Picovoice</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[It’s Time for Local Speech Recognition]]></title>
            <link>https://medium.com/picovoice/its-time-for-local-speech-recognition-df7c911fe944?source=rss----860b548480a7---4</link>
            <guid isPermaLink="false">https://medium.com/p/df7c911fe944</guid>
            <category><![CDATA[speech-recognition]]></category>
            <category><![CDATA[voice-assistant]]></category>
            <category><![CDATA[electron]]></category>
            <category><![CDATA[webassembly]]></category>
            <category><![CDATA[vue]]></category>
            <dc:creator><![CDATA[Davey Bartle]]></dc:creator>
            <pubDate>Fri, 21 May 2021 03:57:25 GMT</pubDate>
            <atom:updated>2022-09-21T18:44:37.935Z</atom:updated>
            <content:encoded><![CDATA[<h4>Creating an offline voice-enabled timer with Electron &amp; Vue</h4><p>Smart devices are surprisingly dumb at voice recognition; to understand our commands, they merely pipe microphone data to a technology giant’s data center for processing. This creates uncomfortable privacy implications of a direct microphone connection from a private residence to a massive corporation. Smart home skills are useful, so what if we could recreate that experience locally, and keep our sensitive data to ourselves?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/633/1*3aig4hvBR4fPMX_pq4mIuA.gif" /><figcaption>The voice timer lights up after hearing the wake word (“Computer”) then processes “Start a timer for three minutes and two seconds”</figcaption></figure><p>A voice-controlled timer is a great smart home skill to have around. In the kitchen, you may have your hands occupied, or covered in flour. Let’s build a proof-of-concept timer app with Electron and Vue using offline Voice AI-powered locally by WebAssembly, instead of a cloud API. A kitchen timer doesn’t need to tell you jokes, order toothpaste, or tell you fun facts, but making it work offline is a win for robustness and privacy.</p><h3>Flipping speech inference upside-down</h3><p>In the current cloud-powered status quo, processing naturally-spoken sentences typically requires anticipating <em>every possible word and phrase in a language</em>, outputting it to text, then deciphering the free-form text to infer meaning.</p><p>Speech-to-Intent is the reverse approach: create a hyper-specialized voice model that by default understands <em>nothing, </em>then define the grammar that solves a particular problem (e.g., a kitchen timer). It’s intuitive as to why this focused approach can provide dramatic improvements over using generic speech recognition.</p><p>The Picovoice <a href="https://picovoice.ai/platform/rhino/">Rhino Speech-to-Intent</a> engine combines this “from scratch” strategy with extreme efficiency to provide full voice models that require very low RAM and CPU usage (they even run on microcontrollers). Building a bespoke voice model sounds daunting, but <a href="https://picovoice.ai/docs/quick-start/console-rhino/">it’s actually about as straightforward as building an Alexa Skill</a>; transfer learning techniques mean no audio training data stage is necessary, just textual descriptions of the words and phrases and grammar to tie them all together.</p><h3>Designing the Voice Model</h3><p>We can start by thinking about the types of expressions we want our app to respond to. For example:</p><blockquote>“Set a timer for 5 minutes”</blockquote><p>From this spoken utterance, we want to know what the intent was (<em>set a timer</em>) and the specific information provided (<em>5 minutes</em>). If we design our model to understand this type of phrase, Rhino can process audio and then return a JSON object with all the relevant details:</p><blockquote>“Set a timer for 5 minutes” → { intent: “setTimer”, slots: { minutes: “5” }}</blockquote><p>To capture this utterance (and similar ones), we can use this syntax:</p><pre>[make, set, create, start] (a, the) timer (for) $pv.SingleDigitInteger:minutes minutes</pre><p>Phrases in square brackets provide a choice. Phrases in parentheses are entirely optional and may be omitted. See the <a href="https://picovoice.ai/docs/tips/syntax-cheat-sheet/">syntax cheat sheet</a> for more details. The item$pv.SingledigitInteger:minutesis a “slot”, which gives us an array of possible choices and assigns the specific choice mentioned to the output.</p><p>This single expression handles many variations in phrasing:</p><blockquote>“Set a timer for 5 minutes”, “Start timer 2 minutes”, “Set the timer for 3 minutes”</blockquote><p>… et cetera.</p><p>Here’s the <a href="https://github.com/Picovoice/picovoice/blob/master/demo/electron/alarm.yaml">grammar source file</a> (YAML format) for this tutorial. It handles hours, minutes, and seconds along with distinct intents for “pause” and “resume”.</p><p>Once we’re satisfied with our grammar, we can train the text into a bespoke voice model. The trained context model is available on <a href="https://github.com/Picovoice/rhino/blob/8b4bbc8044209035800a3bf2bfe8e1a984b48b3d/resources/contexts/wasm/alarm_wasm.rhn">GitHub</a>, under the Apache 2.0 license. Contexts can be designed and trained in <a href="https://picovoice.ai/console/">Picovoice Console</a>.</p><h3>Coding a Voice-enabled Electron/Vue app</h3><p>With a voice model ready, let’s build a quick app. Electron is a tremendously popular platform for making cross-platform desktop applications. We’ll use Electron with Vue as the front-end framework for the GUI. The Picovoice SDK provides a combined wake word engine, Speech-to-Intent engine, and a state machine logic to create a continuous voice assistant interaction loop (e.g., <em>“Jarvis, dim the living room lights”</em>).</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*AZptYoBvvpS28jSTC20cuw.png" /><figcaption>Logos for technology used in the tutorial</figcaption></figure><p>Electron is essentially NodeJS and Chromium glued together, leaving a question as to where our audio processing logic goes. We will be doing all of the audio processing on the Chromium side, which has full support for the <a href="https://developer.mozilla.org/en-US/docs/Web/API/Web_Audio_API">Web Audio API</a> and <a href="https://developer.mozilla.org/en-US/docs/WebAssembly">WebAssembly</a> (details of which are thankfully abstracted completely by the SDK).</p><p>First, install a recent version of the <a href="https://cli.vuejs.org/guide/installation.html">@vue/cli</a> if you have not already. We’ll create a new Vue 3 project, add <a href="https://github.com/nklayman/vue-cli-plugin-electron-builder">electron builder</a>, and then add the <a href="https://picovoice.ai/docs/api/picovoice-vue/">Picovoice SDK for Vue</a> and its peer dependencies.</p><pre><strong>vue create</strong> voice-timer<br><strong>cd</strong> voice-timer<br><strong>vue add</strong> electron-builder<br><strong>yarn add</strong> @picovoice/picovoice-vue @picovoice/web-voice-processor</pre><p>To keep the article succinct, I’ve provided the project on <a href="https://github.com/Picovoice/picovoice/tree/master/demo/electron">GitHub</a>. If you’d like, clone it to obtain the final result.</p><ol><li>Initial setup of package and dependencies (commands from above)</li><li>Add the trained timer model (store as in public directory) and its source grammar (YAML)</li><li>Replace HelloWorld.vue with VoiceTimer.vue. It picks a built-in wake word (I chose “Computer”), provides our timer model as an argument, and outputs voice events to the JavaScript console</li><li>Link the voice commands to timer logic</li></ol><p>VoiceTimer.vue is the heart of the project. It imports the Picovoice composable function and calls init Picovoice with the arguments provided. It watches for wakeWordDetection and inference so it can run events based on voice commands. Calling start starts up the microphone and voice processing. The voice events emitted from Picovoice drive the timer, and the results are reflected in the GUI.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/1*1l1sPGq0JvzYVnJDED23_A.gif" /><figcaption>The finished demo</figcaption></figure><p>We’ve built a minimalist kitchen timer app that provides a small but useful skill <em>without</em> sending microphone data over the internet. Running on Electron makes our app portable, and Vue gives a solid foundation to expand the application’s visual complexity and keep it organized. We can expand the voice model to support things like timer names, and queries, all while keeping everything<em> </em>100% offline.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=df7c911fe944" width="1" height="1" alt=""><hr><p><a href="https://medium.com/picovoice/its-time-for-local-speech-recognition-df7c911fe944">It’s Time for Local Speech Recognition</a> was originally published in <a href="https://medium.com/picovoice">Picovoice</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>