{"id":86055,"date":"2022-03-22T09:00:07","date_gmt":"2022-03-22T03:30:07","guid":{"rendered":"https:\/\/techvidvan.com\/tutorials\/?p=86055"},"modified":"2026-06-03T15:59:59","modified_gmt":"2026-06-03T10:29:59","slug":"python-voice-recorder","status":"publish","type":"post","link":"https:\/\/techvidvan.com\/tutorials\/python-voice-recorder\/","title":{"rendered":"Python Voice Recorder Project with Source Code"},"content":{"rendered":"<p>Have you ever tried recording audio? There are times when we feel the need to record something important. Let us create a voice recorder project using Python which will help us record audio.<\/p>\n<h3>About Voice Recorder<\/h3>\n<p>A Voice Recorder is an application to record audio. The recording is saved and can be shared and seen afterward. We are going to have a start button and a stop button as well.<\/p>\n<h3>Python Voice Recorder Project Details<\/h3>\n<p>The objective of this project is to create a Voice Recorder which will have a start button to start recording and a stop button to stop the recording and save it as well. We will use two Modules to create this project &#8211;<\/p>\n<ul>\n<li>Tkinter Module<\/li>\n<li>PyAudio Module<\/li>\n<\/ul>\n<h3>Project Prerequisites<\/h3>\n<p>Install the following libraries as we are going to use them in our project. The commands to install are the following:<\/p>\n<ul>\n<li>Tkinter Module &#8211; pip install tk<\/li>\n<li>PyAudio Module &#8211; pip install pyaudio<\/li>\n<\/ul>\n<h3>Download Python Voice Recorder Project Code<\/h3>\n<p>Before proceeding ahead, please download the source code of python voice recorder project from the following link: <a href=\"https:\/\/drive.google.com\/file\/d\/1x68KHyOCfEIpveqG3NRiNaMrNUSOcriw\/view?usp=drive_link\"><strong>Voice Recorder Project<\/strong><\/a><\/p>\n<h3>Steps to Build the Voice Recorder Project<\/h3>\n<p>Let us look at the steps to build Python Voice Recorder Project &#8211;<\/p>\n<h4>1. Import the Required Libraries:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">#importing libraries\r\nimport tkinter as tk\r\nfrom tkinter import *\r\nimport recorder\r\n<\/pre>\n<ul>\n<li>To start the project, we are going to import the libraries that we will be using to create the project.<\/li>\n<li>Tkinter Module &#8211; This module will help us create the GUI of our project. It has some inbuilt libraries that will help us create the GUI very easily.<\/li>\n<li>PyAudio Module &#8211; This module is useful to record the audio.<\/li>\n<\/ul>\n<h4>2. Creating GUI Window:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">window = Tk()#creating window\r\nwindow.geometry('700x300')#geometry of window\r\nwindow.title('TechVidvan')#title to window\r\nLabel(window,text=\"Click on Start To Start Recording\",font=('bold',20)).pack()#label\r\n<\/pre>\n<ul>\n<li>In this segment, we are going to create a GUI window with all the necessary elements in the window.<\/li>\n<li>Tk() &#8211; This function helps us create a window. Here we have named our window &#8211; window. After creating the window we specify the geometry and title of the window using the geometry() and title() functions respectively.<\/li>\n<li>Label() &#8211; This function helps us create an area where we can display our specific text. Inside this Label() function, we can specify the font, size, colour etc of the label. We have created two such labels.<\/li>\n<\/ul>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">Button(window,text='Start',bg='green',command=start,font=('bold',20)).pack()#create a button\r\nButton(window,text='Stop',bg='green',command=stop,font=('bold',20)).pack()#create a button\r\n<\/pre>\n<ul>\n<li>Button() &#8211; This function will create a Button on the window. Just like in the label, in the button also we can specify the text on the button, colour, font, size etc. command=record initiates the record function. We have created two buttons &#8211; Start and Stop.<\/li>\n<li>pack() &#8211; To display every widget in the window, we have used the pack() function. Pack() function helps us display the widget without any x and y coordinates.<\/li>\n<\/ul>\n<h4>3. Start Button Functionality:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\"> \r\ndef start():\r\n    global running\r\n \r\n    if running is not None:\r\n        print('already running')\r\n    else:\r\n        running = rec.open('untitled.flac', 'wb')\r\n        running.start_recording()\r\n    Label(window,text='Recording has started').pack()\r\n<\/pre>\n<ul>\n<li>We have created a global variable running. This variable has already been set as None.<\/li>\n<li>When the start button is clicked, an untitled recording is opened using the open() method. After opening the audio file, we start recording using the start_recoding() method.<\/li>\n<li>As soon as the button is clicked, we get a Label displayed that the recording has started.<\/li>\n<\/ul>\n<h4>4. Stop Button Functionality:<\/h4>\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\">def stop():\r\n    global running\r\n \r\n    if running is not None:\r\n        running.stop_recording()\r\n        running.close()\r\n        running = None\r\n        Label(window,text='Recording has stopped').pack()\r\n    else:\r\n        print('not running')\r\n<\/pre>\n<ul>\n<li>As soon as the button is clicked, the recording is stopped using the stop_recording() and immediately after it the recording is closed and saved using the close() method.<\/li>\n<li>When the recording is stopped and saved, we get a Label displayed that the recording is stopped.<\/li>\n<\/ul>\n<p>Hurray! We have completed the Voice Recorder Project. Let\u2019s have a look at the output.<\/p>\n<h3>Python Voice Recorder Output<\/h3>\n<p>After you record audio, you can see that a recording appears.<\/p>\n<p><a href=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/03\/python-voice-recorder-output.webp\"><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-86086\" src=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/sites\/2\/2022\/03\/python-voice-recorder-output.webp\" alt=\"python voice recorder output\" width=\"699\" height=\"329\" \/><\/a><\/p>\n<h3>Summary<\/h3>\n<p>In this article, we have learned how to use Python PyAudio Module and Tkinter Module and create the python voice recorder project. Now we can use this project to record audio and save it.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Have you ever tried recording audio? There are times when we feel the need to record something important. Let us create a voice recorder project using Python which will help us record audio. About&#46;&#46;&#46;<\/p>\n","protected":false},"author":1,"featured_media":86087,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1053],"tags":[3333,483,3249,1092,4680,4681,4682,4683],"class_list":["post-86055","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-python","tag-cool-python-projects","tag-python-project","tag-python-project-for-beginners","tag-python-project-with-source-code","tag-python-voice-recorder","tag-python-voice-recorder-project","tag-python-voice-recorder-project-with-source-code","tag-voice-recorder"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.7 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Python Voice Recorder Project with Source Code - TechVidvan<\/title>\n<meta name=\"description\" content=\"Learn how to use Python PyAudio Module to record the audio and Tkinter Module for GUI and create the Voice Recorder Project.\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/techvidvan.com\/tutorials\/python-voice-recorder\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Python Voice Recorder Project with Source Code - TechVidvan\" \/>\n<meta property=\"og:description\" content=\"Learn how to use Python PyAudio Module to record the audio and Tkinter Module for GUI and create the Voice Recorder Project.\" \/>\n<meta property=\"og:url\" content=\"https:\/\/techvidvan.com\/tutorials\/python-voice-recorder\/\" \/>\n<meta property=\"og:site_name\" content=\"TechVidvan\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/TechVidvan\/\" \/>\n<meta property=\"article:published_time\" content=\"2022-03-22T03:30:07+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2026-06-03T10:29:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2022\/03\/python-voice-recorder-project.webp\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"628\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/webp\" \/>\n<meta name=\"author\" content=\"TechVidvan Team\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:site\" content=\"@vidvantech\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"TechVidvan Team\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"4 minutes\" \/>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"Python Voice Recorder Project with Source Code - TechVidvan","description":"Learn how to use Python PyAudio Module to record the audio and Tkinter Module for GUI and create the Voice Recorder Project.","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/techvidvan.com\/tutorials\/python-voice-recorder\/","og_locale":"en_US","og_type":"article","og_title":"Python Voice Recorder Project with Source Code - TechVidvan","og_description":"Learn how to use Python PyAudio Module to record the audio and Tkinter Module for GUI and create the Voice Recorder Project.","og_url":"https:\/\/techvidvan.com\/tutorials\/python-voice-recorder\/","og_site_name":"TechVidvan","article_publisher":"https:\/\/www.facebook.com\/TechVidvan\/","article_published_time":"2022-03-22T03:30:07+00:00","article_modified_time":"2026-06-03T10:29:59+00:00","og_image":[{"width":1200,"height":628,"url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2022\/03\/python-voice-recorder-project.webp","type":"image\/webp"}],"author":"TechVidvan Team","twitter_card":"summary_large_image","twitter_creator":"@vidvantech","twitter_site":"@vidvantech","twitter_misc":{"Written by":"TechVidvan Team","Est. reading time":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/techvidvan.com\/tutorials\/python-voice-recorder\/#article","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-voice-recorder\/"},"author":{"name":"TechVidvan Team","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22"},"headline":"Python Voice Recorder Project with Source Code","datePublished":"2022-03-22T03:30:07+00:00","dateModified":"2026-06-03T10:29:59+00:00","mainEntityOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-voice-recorder\/"},"wordCount":622,"commentCount":0,"publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-voice-recorder\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2022\/03\/python-voice-recorder-project.webp","keywords":["cool python projects","Python project","python project for beginners","python project with source code","Python Voice Recorder","Python Voice Recorder Project","Python Voice Recorder Project with source code","Voice Recorder"],"articleSection":["Python Tutorials"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/techvidvan.com\/tutorials\/python-voice-recorder\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/techvidvan.com\/tutorials\/python-voice-recorder\/","url":"https:\/\/techvidvan.com\/tutorials\/python-voice-recorder\/","name":"Python Voice Recorder Project with Source Code - TechVidvan","isPartOf":{"@id":"https:\/\/techvidvan.com\/tutorials\/#website"},"primaryImageOfPage":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-voice-recorder\/#primaryimage"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-voice-recorder\/#primaryimage"},"thumbnailUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2022\/03\/python-voice-recorder-project.webp","datePublished":"2022-03-22T03:30:07+00:00","dateModified":"2026-06-03T10:29:59+00:00","description":"Learn how to use Python PyAudio Module to record the audio and Tkinter Module for GUI and create the Voice Recorder Project.","breadcrumb":{"@id":"https:\/\/techvidvan.com\/tutorials\/python-voice-recorder\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/techvidvan.com\/tutorials\/python-voice-recorder\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/python-voice-recorder\/#primaryimage","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2022\/03\/python-voice-recorder-project.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2022\/03\/python-voice-recorder-project.webp","width":1200,"height":628},{"@type":"BreadcrumbList","@id":"https:\/\/techvidvan.com\/tutorials\/python-voice-recorder\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/techvidvan.com\/tutorials\/"},{"@type":"ListItem","position":2,"name":"Python Voice Recorder Project with Source Code"}]},{"@type":"WebSite","@id":"https:\/\/techvidvan.com\/tutorials\/#website","url":"https:\/\/techvidvan.com\/tutorials\/","name":"TechVidvan Blogs","description":"","publisher":{"@id":"https:\/\/techvidvan.com\/tutorials\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/techvidvan.com\/tutorials\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/techvidvan.com\/tutorials\/#organization","name":"TechVidvan","url":"https:\/\/techvidvan.com\/tutorials\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/","url":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","contentUrl":"https:\/\/techvidvan.com\/tutorials\/wp-content\/uploads\/2024\/03\/techvidvan-logo-200x50-1.webp","width":200,"height":50,"caption":"TechVidvan"},"image":{"@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/TechVidvan\/","https:\/\/x.com\/vidvantech"]},{"@type":"Person","@id":"https:\/\/techvidvan.com\/tutorials\/#\/schema\/person\/e9c26e74dd3d87421f7ada9433b8cd22","name":"TechVidvan Team","description":"The TechVidvan Team delivers practical, beginner-friendly tutorials on programming, Java, Python, C++, DSA, AI, ML, data Science, Android, Flutter, MERN, Web Development, and technology. Our experts are here to help you upskill and excel in today\u2019s tech industry."}]}},"amp_enabled":true,"_links":{"self":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/86055","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/comments?post=86055"}],"version-history":[{"count":2,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/86055\/revisions"}],"predecessor-version":[{"id":448160,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/posts\/86055\/revisions\/448160"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media\/86087"}],"wp:attachment":[{"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/media?parent=86055"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/categories?post=86055"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/techvidvan.com\/tutorials\/wp-json\/wp\/v2\/tags?post=86055"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}