everything related to duct tape audio suite (dtas)
 help / color / mirror / code / Atom feed
d363ab9c079e0c15e3b469d10ae362ea51a8e881 blob 1546 bytes (raw)

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
 
#!/usr/bin/env ruby
# Copyright (C) 2013-2015 all contributors <dtas-all@nongnu.org>
# License: GPLv3 or later (https://www.gnu.org/licenses/gpl-3.0.txt)
require 'yaml'
require 'optparse'
require 'dtas/splitfx'
usage = "#$0 [-n|--dry-run][-j [JOBS]][-s|--silent] SPLITFX_FILE.yml [TARGET]"
overrides = {} # FIXME: not tested
opts = { jobs: 1 }
jobs = 1
OptionParser.new('', 24, '  ') do |op|
  op.banner = usage
  op.on('-n', '--dry-run') { opts[:dryrun] = true }
  op.on('-j', '--jobs [JOBS]', Integer) { |val| opts[:jobs] = val } # nil==inf
  op.on('-s', '--quiet', '--silent') { opts[:silent] = true }
  op.on('-D', '--no-dither') { opts[:no_dither] = true }
  op.on('-O', '--outdir OUTDIR') { |val| opts[:outdir] = val }
  op.on('-C', '--compression FACTOR') { |val| opts[:compression] = val }
  op.on('-r', '--rate RATE') { |val| opts[:rate] = val }
  op.on('-b', '--bits RATE', Integer) { |val| opts[:bits] = val }
  op.on('-t', '--trim POSITION') { |val| opts[:trim] = val.tr(',', ' ') }
  op.parse!(ARGV)
end

args = []
ARGV.each do |arg|
  case arg
  when %r{\A(\w+)=(.*)\z}
    key, val = $1, $2
    # only one that makes sense is infile=another_file
    overrides[key] = YAML.load(val)
  when %r{\A(\w+)\.(\w+)=(.*)\z}
    # comments.ARTIST='blah'
    top, key, val = $1, $2, $3
    hsh = overrides[top] ||= {}
    hsh[key] = val
  else
    args << arg
  end
end

file = args.shift or abort usage
target = args.shift || "flac"
splitfx = DTAS::SplitFX.new
splitfx.import(YAML.load(File.read(file)), overrides)
splitfx.run(target, opts)
debug log:

solving d363ab9 ...
found d363ab9 in dtas.git

everything related to duct tape audio suite (dtas)

This inbox may be cloned and mirrored by anyone:

	git clone --mirror https://80x24.org/dtas-all
	git clone --mirror http://ou63pmih66umazou.onion/dtas-all

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V1 dtas-all dtas-all/ https://80x24.org/dtas-all \
		dtas-all@nongnu.org
	public-inbox-index dtas-all

Example config snippet for mirrors.
Newsgroups are available over NNTP:
	nntp://news.public-inbox.org/inbox.comp.audio.dtas
	nntp://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/inbox.comp.audio.dtas
 note: .onion URLs require Tor: https://www.torproject.org/

code repositories for project(s) associated with this inbox:

	../../../dtas.git

AGPL code for this site: git clone http://7fh6tueqddpjyxjmgtdiueylzoqt6pt7hec3pukyptlmohoowvhde4yd.onion/public-inbox.git