Skip to content

Commit

Permalink
Included custom looping and single channel support.
Browse files Browse the repository at this point in the history
  • Loading branch information
L. C. Norberg committed Apr 21, 2016
1 parent bbf7dfe commit ff7204b
Show file tree
Hide file tree
Showing 2 changed files with 66 additions and 24 deletions.
61 changes: 44 additions & 17 deletions d2hgui/Form1.Designer.vb

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

29 changes: 22 additions & 7 deletions d2hgui/Form1.vb
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
Public Class Form1
Public Shared progdir As String = My.Computer.FileSystem.CurrentDirectory
Public Shared hpsvars As String
Public Shared soundtype As String = "stereo"
Sub Button2_Click(sender As Object, e As EventArgs) Handles Button2.Click
OpenFileDialog1.ShowDialog()
End Sub
Expand All @@ -18,7 +20,12 @@
Sub Button1_Click(sender As Object, e As EventArgs) Handles Button1.Click
Dim Originalfile As String
Originalfile = OpenFileDialog1.FileName.ToString()
Dim hpsvars As String = " -y -i """ + Originalfile + """ -ar 32000 -acodec pcm_s16le -map_channel 0.0.0 LEFT.wav -ar 32000 -acodec pcm_s16le -map_channel 0.0.1 RIGHT.wav"
If soundtype = "stereo" Then
hpsvars = " -y -i """ + Originalfile + """ -ar 32000 -acodec pcm_s16le -map_channel 0.0.0 LEFT.wav -ar 32000 -acodec pcm_s16le -map_channel 0.0.1 RIGHT.wav"
End If
If soundtype = "mono" Then
hpsvars = " -y -i """ + Originalfile + """ -ar 32000 -acodec pcm_s16le -map_channel 0.0.0 LEFT.wav -ar 32000 -acodec pcm_s16le -map_channel 0.0.0 RIGHT.wav"
End If
Using runffmpeg As New Process
runffmpeg.StartInfo.Arguments = hpsvars
runffmpeg.StartInfo.FileName = progdir + "\tool\ffmpeg.exe"
Expand All @@ -38,12 +45,12 @@
dspright.WaitForExit()
End Using
Using d2hmake As New Process
d2hmake.StartInfo.Arguments = "--left_dsp LEFT.dsp --right_dsp RIGHT.dsp -o """ + Originalfile + ".hps"""
d2hmake.StartInfo.FileName = progdir + "\tool\dsp2hps.exe"
d2hmake.Start()
d2hmake.WaitForExit()
End Using
IO.File.Delete(progdir + "\tool\left.wav")
d2hmake.StartInfo.Arguments = "--left_dsp LEFT.dsp --right_dsp RIGHT.dsp -o """ + Originalfile + ".hps"" --loop_point" + TextBox2.Text
d2hmake.StartInfo.FileName = progdir + "\tool\dsp2hps.exe"
d2hmake.Start()
d2hmake.WaitForExit()
End Using
IO.File.Delete(progdir + "\tool\left.wav")
IO.File.Delete(progdir + "\tool\right.wav")
IO.File.Delete(progdir + "\tool\left.dsp")
IO.File.Delete(progdir + "\tool\right.dsp")
Expand All @@ -54,4 +61,12 @@
Public Sub WaitForExit()

End Sub

Private Sub RadioButton1_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton1.CheckedChanged
soundtype = "stereo"
End Sub

Private Sub RadioButton2_CheckedChanged(sender As Object, e As EventArgs) Handles RadioButton2.CheckedChanged
soundtype = "mono"
End Sub
End Class

0 comments on commit ff7204b

Please sign in to comment.