擅长:python、mysql、java
<p><strong><em>不再是一个好答案,因为Echo Nest API不再可用。<em>只因历史原因离开</em></p>
<p>考虑一下<a href="http://the.echonest.com/" rel="nofollow noreferrer">Echo Nest</a>API,它可以完美地与Python一起工作,并将返回有关每分钟跳动(可能是您想要的而不是RPM)、平均振幅,甚至任何音频文件的“可跳舞性”的信息。您需要一个API密钥,但除此之外,它是免费的,并且工作良好。</p>
<p>它也有操作音乐的代码,通过他们的回声巢混音包。下面是他们的示例代码:</p>
<pre><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")
</code></pre>