# Beat tracking example
from __future__ import print_function
import librosa
# 1. Get the file path to the included audio example
filename = librosa.util.example_audio_file()
# 2. Load the audio as a waveform `y`
# Store the sampling rate as `sr`
y, sr = librosa.load(filename)
# 3. Run the default beat tracker
tempo, beat_frames = librosa.beat.beat_track(y=y, sr=sr)
print('Estimated tempo: {:.2f} beats per minute'.format(tempo))
# 4. Convert the frame indices of beat events into timestamps
beat_times = librosa.frames_to_time(beat_frames, sr=sr)
print('Saving output to beat_times.csv')
librosa.output.times_csv('beat_times.csv', beat_times)
require 'tmsapi'
# Create Instace of the API
tms = TMSAPI::API.new :api_key => 'API_KEY_HERE'
# Get all movie showtimes for Austin Texas
movie_showings = tms.movies.theatres.showings({ :zip => "78701" })
# Print out the movie name, theatre name, and date/time of the showing.
movie_showings.each do |movie|
movie.showtimes.each do |showing|
puts "#{movie.title} is playing at '#{showing.theatre.name}' at #{showing.date_time}."
end
end
# 12 Years a Slave is playing at 'Violet Crown Cinema' at 2013-12-23T12:45.
# A Christmas Story is playing at 'Alamo Drafthouse at the Ritz' at 2013-12-23T16:00.
# American Hustle is playing at 'Violet Crown Cinema' at 2013-12-23T11:00.
# American Hustle is playing at 'Violet Crown Cinema' at 2013-12-23T13:40.
# American Hustle is playing at 'Violet Crown Cinema' at 2013-12-23T16:20.
# American Hustle is playing at 'Violet Crown Cinema' at 2013-12-23T19:00.
# American Hustle is playing at 'Violet Crown Cinema' at 2013-12-23T21:40.
Audio fingerprinting and recognition algorithm implemented in Python,
see the explanation here:
Dejavu can memorize audio by listening to it once and fingerprinting
it. Then by playing a song and recording microphone input, Dejavu
attempts to match the audio against the fingerprints held in the
database, returning the song being played.
关键词:节拍频谱分析和节律检测。
这是一个众所周知的Python库,它可以包含一个问题的解决方案: https://github.com/aubio/aubio
另外,我建议您检查此页上的其他库: https://wiki.python.org/moin/PythonInMusic
最后,这个项目更适合Python的解决方案和简单的启动方式: https://github.com/librosa/librosa
从Librosa计算歌曲节奏(每分钟拍数)的示例:
但我不得不提的是,这个领域在计算机科学中是一个非常不成熟的领域,每一篇新的论文都是为了这个。所以,如果你也跟着学者们研究最近的发现,这对你会很有用。
添加:
Gracenote官方文档中提到的Web API包装: https://developer.gracenote.com/web-api#python
对于Python:
https://github.com/cweichen/pygn
但正如您所看到的,这个包装器没有很好的文档记录,也不成熟。因此,我建议您使用这个Ruby包装器而不是Python
对于Ruby:
https://github.com/JDiPierro/tmsapi
如果您不喜欢Ruby或Ruby on Rails,那么惟一的选择就是开发自己的Python包装器。
最后我使用了ACRCloud这个方法非常有效。似乎每个想使用Gracenote的人都会因为一些原因而回到ACRCloud。。。现在我知道为什么了。
Python示例:
只需阅读标题问题,由于没有GNSDK的示例或教程,请尝试查看其他选项,
其中之一:
德哈武
https://github.com/worldveil/dejavu
似乎是对的。
相关问题 更多 >
编程相关推荐