Skip to content

Instantly share code, notes, and snippets.

@youpy
Created December 12, 2012 04:50
Show Gist options
  • Save youpy/4264945 to your computer and use it in GitHub Desktop.
Save youpy/4264945 to your computer and use it in GitHub Desktop.
create m4a with chapters
# -*- coding: utf-8 -*-
require 'scissor'
# https://github.com/youpy/chapter
require 'chapter'
duraton = 60
outfile = '/Users/youpy/Desktop/chapters.m4a'
Scissor.silence(duraton) >> outfile
chapters = 120.times.inject([]) do |result, i|
result + [{"title" => "あ" + i.to_s, "duration" => 500}]
end
Chapter.set_chapters(outfile, chapters)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment