-
Notifications
You must be signed in to change notification settings - Fork 20
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
5 changed files
with
21 additions
and
28 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,63 +1,56 @@ | ||
require "open-uri" | ||
require_relative "media-transcoder" | ||
require_relative "image-transcoder" | ||
require_relative "audio-transcoder" | ||
require_relative "audio-concat-transcoder" | ||
|
||
p "starting image transcoding job..." | ||
p "fetching image from the cat api..." | ||
puts "starting image transcoding job..." | ||
|
||
open("#{__dir__}/assets/cat.jpg") do |f| | ||
p "starting transcoding job..." | ||
image_transcoder = ImageTranscoder.new | ||
response = image_transcoder.transcode!(f) | ||
|
||
# if you are using rails one thing you can do would be to start an ActiveJob process that recursively | ||
# checks on the status of the assembly until it is finished | ||
p "checking job status..." | ||
puts "checking job status..." | ||
response.reload_until_finished! | ||
|
||
p response[:message] | ||
p response[:results]["image"][0]["ssl_url"] | ||
puts response[:message] | ||
puts response[:results]["image"][0]["ssl_url"] | ||
puts "\n" | ||
end | ||
|
||
p "starting audio transcoding job..." | ||
p "fetching soundbite from nasa..." | ||
p "\n" | ||
puts "starting audio transcoding job..." | ||
|
||
open("#{__dir__}/assets/Computers_are_in_Control.flac") do |f| | ||
p "starting transcoding job..." | ||
audio_transcoder = AudioTranscoder.new | ||
response = audio_transcoder.transcode!(f) | ||
|
||
# if you are using rails one thing you can do would be to start an ActiveJob process that recursively | ||
# checks on the status of the assembly until it is finished | ||
p "checking job status..." | ||
puts "checking job status..." | ||
response.reload_until_finished! | ||
|
||
p response[:message] | ||
p response[:results]["mp3"][0]["ssl_url"] | ||
p "\n" | ||
puts response[:message] | ||
puts response[:results]["mp3"][0]["ssl_url"] | ||
puts "\n" | ||
end | ||
|
||
p "starting audio concat transcoding job..." | ||
p "fetching 3 soundbites from nasa..." | ||
puts "starting audio concat transcoding job..." | ||
|
||
files = [ | ||
"#{__dir__}/assets/APU_Shutdown.mp3", | ||
"#{__dir__}/assets/Go_for_Deploy.mp3", | ||
"#{__dir__}/assets/Lookin_At_It.mp3" | ||
] | ||
|
||
p "starting transcoding job..." | ||
audio_concat_transcoder = AudioConcatTranscoder.new | ||
response = audio_concat_transcoder.transcode!(files) | ||
|
||
# if you are using rails one thing you can do would be to start an ActiveJob process that recursively | ||
# checks on the status of the assembly until it is finished | ||
p "checking job status..." | ||
puts "checking job status..." | ||
response.reload_until_finished! | ||
|
||
p response[:message] | ||
p response[:results]["concat"][0]["ssl_url"] | ||
p "\n" | ||
puts response[:message] | ||
puts response[:results]["concat"][0]["ssl_url"] | ||
puts "\n" |