Skip to content

Commit

Permalink
Testing ability to generate spectrograms
Browse files Browse the repository at this point in the history
  • Loading branch information
Mark Cottman-Fields committed Oct 22, 2012
1 parent e6b3fd0 commit e5de191
Show file tree
Hide file tree
Showing 6 changed files with 18 additions and 0 deletions.
15 changes: 15 additions & 0 deletions app/controllers/media_controller.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
class MediaController < ApplicationController
def index
@input_path = './test/fixtures/'
@output_path = './public/tests/'

@audio = 'TorresianCrow.wav'
@image = 'TorresianCrow.png'

@input_audio = @input_path + @audio
@output_image = @output_path + @image

stdout_str, stderr_str, status = Open3.capture3("./vendor/bin/sox/windows/sox.exe -V \"#{@input_audio}\" -n rate 22050 spectrogram -m -r -l -a -q 249 -w hann -y 257 -X 43.06640625 -z 100 -o \"#{@output_image}\"")
@result = [stdout_str, stderr_str, status]
end
end
3 changes: 3 additions & 0 deletions app/views/media/index.html.erb
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
<%= @result %>

<%= image_tag("/tests/#{@image}", :alt => "image") %>
Binary file added vendor/bin/sox/windows/libgomp-1.dll
Binary file not shown.
Binary file added vendor/bin/sox/windows/pthreadgc2.dll
Binary file not shown.
Binary file added vendor/bin/sox/windows/sox.exe
Binary file not shown.
Binary file added vendor/bin/sox/windows/zlib1.dll
Binary file not shown.

0 comments on commit e5de191

Please sign in to comment.