Last active
September 25, 2022 17:28
-
-
Save jneen/2019c9f6910aa1bcaa646a99e1eaf1b9 to your computer and use it in GitHub Desktop.
Revisions
-
jneen revised this gist
Sep 25, 2022 . No changes.There are no files selected for viewing
-
jneen revised this gist
Sep 25, 2022 . No changes.There are no files selected for viewing
-
jneen revised this gist
Sep 25, 2022 . 1 changed file with 4 additions and 1 deletion.There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -1,5 +1,8 @@ #!/usr/bin/env bash # .als file FILE="$1"; shift SCRIPT="$(cat <<RUBY \$_.scan(%r[<CurrentStart Value="(.*?)"/><Name Value="(.*?)"/>]) do |start, name| frame = (start.to_f * 8).round @@ -14,6 +17,6 @@ end RUBY )" gzip -d <"$FILE" |\ xmllint --xpath '//AudioClip/CurrentStart | //AudioClip/Name' - |\ ruby -ne "$SCRIPT" -
jneen created this gist
Sep 25, 2022 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,19 @@ #!/usr/bin/env bash SCRIPT="$(cat <<RUBY \$_.scan(%r[<CurrentStart Value="(.*?)"/><Name Value="(.*?)"/>]) do |start, name| frame = (start.to_f * 8).round seconds, frame = frame.divmod(30) minutes, seconds = seconds.divmod(60) hours, minutes = minutes.divmod(60) stamp = [hours, minutes, seconds, frame].map { |n| sprintf("%02d", n) }.join(':') puts "#{stamp} #{name}" end RUBY )" gzip -d <"$file" |\ xmllint --xpath '//AudioClip/CurrentStart | //AudioClip/Name' - |\ ruby -ne "$SCRIPT"