Skip to content

Commit

Permalink
Add in live microphone transcription
Browse files Browse the repository at this point in the history
  • Loading branch information
VikParuchuri committed Jun 16, 2022
1 parent 67612fc commit 81b0801
Showing 1 changed file with 28 additions and 9 deletions.
37 changes: 28 additions & 9 deletions speech_recognition/voice.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,18 @@
"cells": [
{
"cell_type": "markdown",
"id": "53cee9a2-6688-4e74-a5ab-d07c13892414",
"id": "5077d022-9c52-479c-9cdb-06ad1a66a064",
"metadata": {},
"source": [
"%pip install vosk"
"https://github.com/dataquestio/project-walkthroughs/tree/master/speech_recognition"
]
},
{
"cell_type": "markdown",
"id": "6e32a64c-581f-4080-9a22-30fa74c0d51b",
"id": "53cee9a2-6688-4e74-a5ab-d07c13892414",
"metadata": {},
"source": [
"%pip install pydub"
"%pip install vosk"
]
},
{
Expand All @@ -23,7 +23,6 @@
"metadata": {},
"outputs": [],
"source": [
"from pydub import AudioSegment\n",
"from vosk import Model, KaldiRecognizer"
]
},
Expand Down Expand Up @@ -63,6 +62,26 @@
"rec.SetWords(True)"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "1fbfa3f6-eb58-4e38-b4ab-1b089eac9e2b",
"metadata": {},
"outputs": [],
"source": [
"%pip install pydub"
]
},
{
"cell_type": "code",
"execution_count": null,
"id": "2b7ad229-3be5-456d-b8b7-0a112dfbbd2e",
"metadata": {},
"outputs": [],
"source": [
"from pydub import AudioSegment"
]
},
{
"cell_type": "code",
"execution_count": 36,
Expand Down Expand Up @@ -204,7 +223,7 @@
" rec.SetWords(True)\n",
" \n",
" mp3 = AudioSegment.from_mp3(filename)\n",
" mp3 = mp3.set_channels(1)\n",
" mp3 = mp3.set_channels(CHANNELS)\n",
" mp3 = mp3.set_frame_rate(FRAME_RATE)\n",
" \n",
" step = 45000\n",
Expand Down Expand Up @@ -502,14 +521,14 @@
},
{
"cell_type": "code",
"execution_count": 31,
"execution_count": 1,
"id": "06c1a352-b0ab-44a7-bbab-9ff0abb03794",
"metadata": {},
"outputs": [
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "977978d0bb5443f884dd119c11306de0",
"model_id": "a37e23e414ae4f34b1795c959d91620c",
"version_major": 2,
"version_minor": 0
},
Expand All @@ -523,7 +542,7 @@
{
"data": {
"application/vnd.jupyter.widget-view+json": {
"model_id": "1aff59cefe5841a1864efe46b1e7101d",
"model_id": "9e527244102644028dbfe577de07c46b",
"version_major": 2,
"version_minor": 0
},
Expand Down

0 comments on commit 81b0801

Please sign in to comment.