In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >
Share
Shulou(Shulou.com)05/31 Report--
This article introduces the relevant knowledge of "how to extract spectrum music from python". In the operation of actual cases, many people will encounter such a dilemma. Then let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
1. Prepare for
Before you begin, make sure that Python and pip are successfully installed on your computer. Oh, if not, please visit this article: hyperdetailed Python installation Guide for installation.
Open Cmd (start-run-CMD) in Windows environment, and open Terminal (command+ space input Terminal) in Apple system environment, ready to start entering commands to install dependencies.
Of course, I recommend that you use the VSCode editor to Copy the code of this article and install the dependency module in the terminal at the bottom of the editor. What a comfortable thing: the best partner of Python programming-VSCode detailed guide.
Enter the following command at the terminal to install the dependent module we need:
Pip install pydubpip install librosa
If you see Successfully installed xxx, the installation is successful.
two。 Spectrum display
With librosa and matplot, we can fully display the entire spectrum in 10 lines of code:
However, this kind of spectrum is the whole piece of music, and it looks very ugly, so we use pydub to cut the spectrum to get better results. Let's break down to a range of 0 to 1 seconds to view the spectrum:
This is fine, but it is still too complicated. in fact, when we show the spectrum, we only need a positive value:
Then we can further zoom in, for example, the spectrum between 0.9 and 1 second:
This is the end of the content of "how to extract Spectrum Music from python". Thank you for reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.