Python Audio Processing Basics - How to work with audio files in Python

Поділитися
Вставка
  • Опубліковано 30 чер 2024
  • Learn how to work with audio files in Python in this Python Audio Processing Tutorial. Learn about:
    - mp3, wave, flac file
    - sampling rate
    - wave module Python
    - plot waveform with matplotlib
    - record microphone with Python
    - PyAudio Tutorial
    - PyDub Tutorial
    Get your Free Token for AssemblyAI Speech-To-Text API 👇www.assemblyai.com/?...
    Resources:
    PyAudio: people.csail.mit.edu/hubert/py...
    M1 PyAudio Installation command:
    python -m pip install --global-option='build_ext' --global-option='-I/opt/homebrew/Cellar/portaudio/19.7.0/include' --global-option='-L/opt/homebrew/Cellar/portaudio/19.7.0/lib' pyaudio
    ▬▬▬▬▬▬▬▬▬▬▬▬ CONNECT ▬▬▬▬▬▬▬▬▬▬▬▬
    🖥️ Website: www.assemblyai.com
    🐦 Twitter: / assemblyai
    🦾 Discord: / discord
    ▶️ Subscribe: ua-cam.com/users/AssemblyAI?...
    🔥 We're hiring! Check our open roles: www.assemblyai.com/careers
    ▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬▬
    Timestamps:
    00:00 Intro
    00:27 signal parameters
    03:18 wave module
    10:44 plot waveform matplotlib
    15:40 record microphone with PyAudio
    21:50 load mp3 with PyDub
    Headphones icons created by photo3idea_studio - Flaticon: www.flaticon.com/free-icons/h...
    Microphone icons created by Freepik - Flaticon: www.flaticon.com/free-icons/m...
    #Python #PyAudio

КОМЕНТАРІ • 25

  • @mayankdwivedi1893
    @mayankdwivedi1893 2 роки тому +2

    Extremely helpful video ! kudos man!

  • @InternetGeezer
    @InternetGeezer Рік тому

    Thank you, this tutorial was so helpful!

  • @rubenguerrerorivera7462
    @rubenguerrerorivera7462 4 місяці тому

    Awesome! thanks!

  • @subhomandal9165
    @subhomandal9165 2 роки тому

    That’s so nice to see the audio modules together.
    But, what if I want to do the recording and getting it out through some STT-TTS module at the runtime, without need of saving the file?

  • @__________________________6910
    @__________________________6910 2 роки тому +1

    Noice ! Pratick

  • @bryanfondrick5247
    @bryanfondrick5247 2 роки тому +1

    Very nice video, but could you turn off the pop ups. Some times it is hard to see what you are typing.

  • @TheMorphingOne
    @TheMorphingOne Місяць тому

    Thank you

  • @sandymlgenai
    @sandymlgenai Рік тому

    Given a flute music file, how can we convert the music to notes and decompress the file back to audio blocks using literally any method( trained spectograms, any ML algorithm..)

  • @mayankdwivedi1893
    @mayankdwivedi1893 2 роки тому

    How can the 'frames' object have bytes as its data type? It is a collection of Integers right? Shouldn't it be of type 'list'?

  • @dexnug
    @dexnug 2 роки тому

    hi..what is the meaning y-axis in the 15:31??what is the meaning of that number?

  • @Since-em2vy
    @Since-em2vy 3 місяці тому

    woow wowww wwowowwww🤩😄😄

  • @josales3570
    @josales3570 Рік тому

    Hey, could you help me in my project? I'm trying to play audio from youtube videos. Using pytube I have the audio stream "" but I dont want to save in the computer, and then load in memory again. Do you know how to play this stream with pyaudio?

  • @__________________________6910
    @__________________________6910 2 роки тому +4

    Which extension you are using to play the audio file in the vs code. comment the extension name.

  • @ieatgarbage8771
    @ieatgarbage8771 Рік тому +1

    I’m kind of a noob. How is frames[0] of type int if frames is a bytes object? And why is the length still double if each element of frames is of type int?

  • @q2ten
    @q2ten Рік тому +1

    I'm getting a ValueError every time I try and use this with my audio, is there any chance i could get some help? The error code says "ValueError: x and y must have same first dimension, but have shapes (22043,) and (44086,)", I know they need to be the same length but .reshape doesn't work and I have no idea what to do

    • @drueh5041
      @drueh5041 Рік тому +3

      Change your data type in "signal_array = np.frombuffer(signal_wave, dtype=np.int32)"

    • @q2ten
      @q2ten Рік тому

      @@drueh5041 thanks I’ll try that

  • @vjayanand1
    @vjayanand1 3 місяці тому

    Hi, I get an error stating OSError: [Errno -9981] Input overflowed. OSError Traceback (most recent call last)
    Cell In[23], line 16
    14 while True:
    15 i += 1
    ---> 16 data = stream.read(CHUNK)
    17 rms = audioop.rms(data,2)
    File ~/anaconda3/lib/python3.10/site-packages/pyaudio/__init__.py:570, in PyAudio.Stream.read(self, num_frames, exception_on_overflow)
    567 if not self._is_input:
    568 raise IOError("Not input stream",
    569 paCanNotReadFromAnOutputOnlyStream)
    --> 570 return pa.read_stream(self._stream, num_frames,
    571 exception_on_overflow)

  • @gourabguha3167
    @gourabguha3167 4 місяці тому

    Could you share the code repo pls

  • @andrewildschutz5356
    @andrewildschutz5356 5 місяців тому +3

    Coding is so confusing and not consistent.