2015-09-14 41 views

回答

0

嘗試Audite - a portable mp3 player in Ruby

API示例

require 'audite' 

player = Audite.new 

player.events.on(:complete) do 
    exit 
end 

player.events.on(:level) do |level| 
    puts level 
end 

player.events.on(:position_change) do |pos| 
    puts pos 
end 

player.load('test.mp3') 
player.start_stream 
player.forward(20) 

OSX安裝

brew install portaudio 
brew install mpg123 

gem install audite 

於Debian/Ubuntu安裝

apt-get install libportaudiocpp0 portaudio19-dev libmpg123-dev 
gem install audite 
相關問題