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

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

AssemblyAI

2 года назад

54,681 Просмотров

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 👇https://www.assemblyai.com/?utm_source=youtube&utm_medium=referral&utm_campaign=yt_pat_38

Resources:
PyAudio: http://people.csail.mit.edu/hubert/pyaudio/

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: https://www.assemblyai.com
🐦 Twitter: https://twitter.com/AssemblyAI
🦾 Discord: https://discord.gg/Cd8MyVJAXd
▶️ Subscribe: https://www.youtube.com/c/AssemblyAI?sub_confirmation=1
🔥 We're hiring! Check our open roles: https://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: https://www.flaticon.com/free-icons/headphones
Microphone icons created by Freepik - Flaticon: https://www.flaticon.com/free-icons/microphone

#Python #PyAudio
Ссылки и html тэги не поддерживаются


Комментарии:

@carltonkess862
@carltonkess862 - 17.08.2023 08:26

Thank you for this! Anyone have an idea of the color theme being used here??

Ответить
@ieatgarbage8771
@ieatgarbage8771 - 13.04.2023 07:16

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 - 21.01.2023 10:53

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

Ответить
@InternetGeezer
@InternetGeezer - 01.12.2022 19:32

Thank you, this tutorial was so helpful!

Ответить
@sandhiyaprabhakannuraj1079
@sandhiyaprabhakannuraj1079 - 19.11.2022 11:56

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..)

Ответить
@bryanfondrick5247
@bryanfondrick5247 - 17.06.2022 20:55

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

Ответить
@mayankdwivedi1893
@mayankdwivedi1893 - 15.06.2022 05:23

Extremely helpful video ! kudos man!

Ответить
@mayankdwivedi1893
@mayankdwivedi1893 - 15.06.2022 05:22

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'?

Ответить
@subhomandal9165
@subhomandal9165 - 26.05.2022 20:52

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 - 26.05.2022 18:26

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

Ответить
@__________________________6910
@__________________________6910 - 26.05.2022 18:21

Noice ! Pratick

Ответить