How to Record Audio and Graph wave .wav files using Python!

แชร์
ฝัง
  • เผยแพร่เมื่อ 15 มิ.ย. 2022
  • Code available here:
    github.com/ple...
    This is a quick and easy Python tutorial where I show you how to use several great Python modules and packages to record audio through a microphone or audio device on your computer with the PyAudio Python Module. I then show you how to process the data using the WAVE .wav file audio editing module. Lastly I show how to graph and display the recorded file using the numpy and matplotlib python plug in modules.
    Love the content on this channel? Feel free to support me on Patreon!
    / lemastertech
    What do you want to see in a future video? Be sure to leave a comment below saying what you want in future videos or letting me know if you had any questions about this tutorial!
    Thanks for watching, and be sure to leave a like or subscribe to the channel to stay up to speed with all our future projects!
  • วิทยาศาสตร์และเทคโนโลยี

ความคิดเห็น • 34

  • @electron46
    @electron46 ปีที่แล้ว

    Excellent video. Terrific topic. Like having the code already typed out. That way I don't have to listen to clickity-clackity key presses and watching misspelled words retyped. Thank you very much.

    • @lemastertech
      @lemastertech  ปีที่แล้ว

      Thank you for the kind comment! I appreciate your feedback an I'm glad you liked the video!!

  • @natyacodes
    @natyacodes 2 ปีที่แล้ว +2

    Thanks for the great and quick information! keep making such content!

    • @lemastertech
      @lemastertech  2 ปีที่แล้ว +1

      Thanks for the nice comment!! I will keep it up for sure :)

  • @rethanon
    @rethanon 2 ปีที่แล้ว +1

    Interesting video as usual, I prefer the tutorials where we can follow along, but it did make a nice change. Keep it up, road to 5k! Have you considered setting up on Patreon?

    • @lemastertech
      @lemastertech  2 ปีที่แล้ว

      Hi Dale! Glad you found this one interesting, and I think the follow along line by line format is more fun for me to make and feels more natural too, I just got a little slammed with my day job this week haha. Thanks for the comment!! I have not thought much about a Patreon but that’s an interesting concept!! I could maybe do some complete games or in depth tutorials for patreon supporters in addition to the stuff on TH-cam! Neat idea, I’ll have to look into it!

  • @JasonButler007
    @JasonButler007 ปีที่แล้ว +1

    You don't need to change the dtype to 32bit for stereo, and doing that just increases the resolution / precision of what is recorded. You need to change shape of the np array so it is two dimensional, one per channel, but each can use int16 no problem. Some hardware doesn't support 32bit so this might be important.

    • @lemastertech
      @lemastertech  ปีที่แล้ว

      Thank for the clarification hopefully some others can find this comment useful too!

  • @dingowhiz481
    @dingowhiz481 5 หลายเดือนก่อน +1

    Exactly what I needed for my project. Just wondering whether it is possible to set the audio input as a web browser or application like Zoom/Teams instead of a microphone?

    • @lemastertech
      @lemastertech  5 หลายเดือนก่อน

      Hello! Yes this same type of application would definitely be possible but it would be considered much more capturing computer audio rather than recording through a microphone. There isn’t really a sound input device in this case and it would need to basically record the audio from another app!

  • @dubpper98
    @dubpper98 2 ปีที่แล้ว +1

    very nice! really nice python audio tutorials, thanks

    • @lemastertech
      @lemastertech  2 ปีที่แล้ว

      You are welcome! Thanks for the feedback!

  • @Eliyan213
    @Eliyan213 หลายเดือนก่อน +1

    Hello! do you know if instead of recording I can upload an audio file (mp3) and then analyze it?

    • @lemastertech
      @lemastertech  หลายเดือนก่อน

      Hi! Yes rather than recording and then analyzing a live audio clip just import, possibly convert to wav since it’s easier to pick apart and then analyze!

  • @Eliyan213
    @Eliyan213 หลายเดือนก่อน +1

    Can you use miliseconds as opposed to seconds?

    • @lemastertech
      @lemastertech  หลายเดือนก่อน

      Probably! Sorry this project was along time ago and I’m not sure off the top of my head!

  • @chriswisteria6961
    @chriswisteria6961 10 หลายเดือนก่อน +1

    Thank you so much. Also is there any way that a waveform once plotted can be converted to an audio file and saved to the device?

    • @lemastertech
      @lemastertech  10 หลายเดือนก่อน

      Hello, yes it is - I believe in this video we save the waveforms as a .wav file which can be easily converted to an mp3 or other playable audio file. I know this video was a long time ago but I believe what you’re asking for is in this video

  • @SabanWikipedia
    @SabanWikipedia ปีที่แล้ว

    hi thats was a nice videos, i want to ask, can we crop the audio using python? i mean split the full audio itu seconds?

    • @lemastertech
      @lemastertech  ปีที่แล้ว

      You can! You just select which “frames” of the raw audio recording you want, and either cut the rest out or store it somewhere else. The frames variable is what you need to manipulate for that

  • @citiznfjle7132
    @citiznfjle7132 ปีที่แล้ว

    Your video project is excellent! Thanks for making it. I tried installing the pyaudio module and get the no module found error. Doing a pip list shows it's there but the name was PyAudio. I'm wondering if the video use a different version of the module than the one I picked up?

    • @lemastertech
      @lemastertech  ปีที่แล้ว

      Hi, sometimes this is because pip might install to a generic location on your C/ folder but depending on the IDE you use you might need to install to your specific project folder so rather than c/ pip install pyaudio the command would be like c/program files/pycharm/recordproject pip install pyaudio and actually direct pip to this project! Goodluck!

    • @citiznfjle7132
      @citiznfjle7132 ปีที่แล้ว

      @@lemastertech Thanks for the advice! Yesterday I tried changing the selected interpreter on the VS and that seemed to work pyaudio was happy. Directing pip to a particular project is cool. I didn't know that was possible. I should do that all the time.

  • @AmitKumarSahoo
    @AmitKumarSahoo 2 ปีที่แล้ว

    Is it possible to Write a function which takes an audio file as an input and outputs the vowel as a string from a recorded WAV file? Like, if I was supposed to detect the vowels from my recorded audio speech sample WAV file...

    • @lemastertech
      @lemastertech  2 ปีที่แล้ว

      Hi! You could do that if you used a speech to text API! I suggest using someone like assemblyAI who has a free API you can get from their website! They will translate an audio recording to text then you can sort the text just like you’d sort a string! Good luck!

  • @wissem7781
    @wissem7781 ปีที่แล้ว +1

    Support ❤️❤️

  • @tanthai66
    @tanthai66 ปีที่แล้ว

    can you explain for me about b' ' join. I forgot what does b' ' in Python means? Thank you !

    • @lemastertech
      @lemastertech  ปีที่แล้ว

      Hi, what part of the video are you looking at? Can you share a timestamp where this pops up? I don’t fully understand what you’re asking?

    • @mertmert6989
      @mertmert6989 ปีที่แล้ว +1

      b" " is a notation for binary sequence. As you can see, above the statement a wav file opened with "wb" argument, that is writing in binary. Hence you need to write in binary format inside the file opened.

  • @autoauto2000
    @autoauto2000 6 หลายเดือนก่อน +1

    line by line, plz😊

    • @lemastertech
      @lemastertech  6 หลายเดือนก่อน

      Hi! I probably won’t do this particular one line by line since it’s been a while since I did this project but I am working on some more tutorials on sound processing soon!! 😊

  • @pranavnyavanandi9710
    @pranavnyavanandi9710 2 ปีที่แล้ว +1

    Hi 👋