Introduction
Introduction Statistics Contact Development Disclaimer Help
Add support for importing 8k 16-bit LE wav files - warvox - VoIP based wardiali…
Log
Files
Refs
README
---
commit 9b49aadb91747287f301d8e037c26308eb2f47c8
parent 1f8800ab3989180223c393dc3ae820f14319e295
Author: HD Moore <[email protected]>
Date: Sun, 1 May 2016 21:42:05 -0500
Add support for importing 8k 16-bit LE wav files
Diffstat:
M bin/import_audio.rb | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
---
diff --git a/bin/import_audio.rb b/bin/import_audio.rb
@@ -38,7 +38,7 @@ require 'config/environment'
project_id = ARGV.shift
provider_id = ARGV.shift
-todo = Dir["#{dir}/**/*.raw"].to_a
+todo = Dir["#{dir}/**/*.raw"].to_a + Dir["#{dir}/**/*.wav"].to_a
if todo.empty?
$stderr.puts "Error: No raw audio files found within #{dir}"
@@ -115,6 +115,13 @@ todo.each do |rfile|
mr = dr.media
::File.open(rfile, "rb") do |fd|
+
+ # Dirty support for RIFF (little-endian) data, WAVE audio, Microsoft PCM, …
+ if rfile =~ /\.wav$/
+ # Toss the WAV header
+ head = fd.read(44)
+ end
+
mr.audio = fd.read(fd.stat.size)
mr.save
end
You are viewing proxied material from jay.scot. The copyright of proxied material belongs to its original authors. Any comments or complaints in relation to proxied material should be directed to the original authors of the content concerned. Please see the disclaimer for more details.