2020-10-01から1ヶ月間の記事一覧

MP3ファイルの分割(ffmpeg, Ruby)

ffmpeg と Ruby を使って、MP3ファイルを分割します。こんな感じ。 cut_mp3.rb file = DATA.gets.chomp ts = DATA.gets.split.map {|t| t.split(":").map(&:to_i)} Dir.chdir(File.dirname(file)) bname = File.basename(file, ".mp3") ts.map {_1 * 3600 + …

ruby 3.0.0preview1 をちょっと使ってみる

環境は Linux Mint 20 です。 Ractor まずは Ractor。 https://github.com/ruby/ruby/blob/master/doc/ractor.md https://github.com/ko1/ruby/blob/ractor/ractor.ja.md 下を見ていじくるとよい。 qiita.com とりあえずこれ。 Ractor.new do 5.times do put…