Music Analysis and Visualization

前端 未结 3 1891
我在风中等你
我在风中等你 2021-01-30 07:47

I\'m interested in programming a music visualizer in Python.

The first problem is how to get the information from the music? Like volume, frequency, rpm, etc. And from w

3条回答
  •  后悔当初
    2021-01-30 08:01

    No longer a good answer since Echo Nest API is no longer available. Leaving for historical reasons only

    Consider the Echo Nest API which works perfectly with Python and will return information about beats per minute (probably what you want instead of RPM), average amplitude, even "dancibility" for any audio file. You need an API key, but besides that it's free and works well.

    It also has code for manipulating music as well, via their Echo Nest Remix package. Here's their example code:

    """Reverse a song by playing its beats 
       forward starting from the end of the song"""
    import echonest.audio as audio   
    
    # Easy around wrapper mp3 decoding and Echo Nest analysis
    audio_file = audio.LocalAudioFile("NeverGonnaTellIt.mp3")
    
    # You can manipulate the beats in a song as a native python list
    beats = audio_file.analysis.beats
    beats.reverse()
    
    
    # And render the list as a new audio file!
    audio.getpieces(audio_file, beats).encode("NeverGonnaTellItBackwardsByBeat.mp3")
    

提交回复
热议问题