View Single Post
Old 27th July 2006, 01:10   #113  |  Link
tebasuna51
Moderator
 
tebasuna51's Avatar
 
Join Date: Feb 2005
Location: Spain
Posts: 6,915
Quote:
Originally Posted by raquete
can you (maybe) do that?
Now with Aften only need one step in WaveWizard (remmaping not needed).

There are also a double conversion not recommendable:
float -> Int 16 (AviSynth) -> float (Aften).

But if you have many conversions to do and/or don't want create the intermediate wav6 files ...

To automatize using AviSynth you need create .avs files like:
Code:
a = BassAudioSource("X:\Xpath\x_fLfR.wav")
fl = GetChannel(a, 1)
fr = GetChannel(a, 2)
b = BassAudioSource("X:\Xpath\x_CLFE.wav")
c = GetChannel(b, 1)
lfe = GetChannel(b, 2)
d = BassAudioSource("X:\Xpath\x_slsr.wav")
sl = GetChannel(d, 1)
sr = GetChannel(d, 2)
MergeChannels(fl, fr, c, lfe, sl, sr)
And after execute batch files like:
Code:
bepipe --script "Import(^X:\Xpath\x1.avs^)" | aften -b 448000 - x1.ac3
bepipe --script "Import(^X:\Xpath\x2.avs^)" | aften -b 448000 - x2.ac3
...
The problem is only write paths and names of the files. To help this job I write 3wav1ac3.vbs
Code:
' This file (3wav1ac3.vbs) must be
' in the same folder than bepipe.exe and aften.exe
'
' You can Drag & Drop the *fLfR.wav file/s over this file or
' over a ShortCut created on Desktop.

' Autor: tebasuna
'
Dim wsh, args, fso, fe, fe2, fe3, fg, fa
title="3wav1ac3 Script"
' get input files
Set wsh = WScript.CreateObject("WScript.Shell")
Set args = WScript.Arguments
If args.Count = 0 Then
  MsgBox "Special Aften ac3 encoder script." & vbCR & _
	"Use drag & drop to specify the *fLfR.wav sources.", vbInformation, title
  WScript.Quit
End If
' check path
Set fso = CreateObject("Scripting.FileSystemObject")
' Search aften.exe at same folder than 3wav1ac3.vbs
aften = WScript.ScriptFullName
camino = left(aften, len(aften) - len(WScript.ScriptName))
aften = camino & "aften.exe"
If Not fso.FileExists(aften) Then
  MsgBox "Don't found aften!" & vbCR & "(must be at '" & aften & "')", vbCritical, title
  WScript.Quit
End If
' Search bepipe.exe at same folder than 3wav1ac3.vbs
bepipe = camino & "bepipe.exe"
If Not fso.FileExists(bepipe) Then
  MsgBox "Don't found bepipe!" & vbCR & "(must be at '" & bepipe & "')", vbCritical, title
  WScript.Quit
End If
' Options to encode. Here we can put defaults or capture other parameters.
msg = "Bitrate to encode."
msg = msg & chr(13) & "Accepted values:"
msg = msg & chr(13) & "320, 384, 448, 512, 576 or 640 Kb/s"
p = InputBox(msg, "Bitrate", "448")
opts = " -b " & p & "000 - "
'
aften = Chr(34) & aften & CHR(34) & Chr(32)
bepipe = Chr(34) & bepipe & CHR(34)
bat = 0 ' bat not open
For i = 0 To args.Count-1
  fe = args(i)
  ' check input file
  If fso.FileExists(fe) Then
    pre = Left(fe, Len(fe) - 8)
    suf = LCase(Right(fe, 8))
    If suf = "flfr.wav" then
     fe2 = pre & "CLFE.wav"
     fe3 = pre & "slsr.wav"
     If fso.FileExists(fe2) Then
      If fso.FileExists(fe3) Then
' write .avs file
       Set fa = fso.CreateTextFile(pre & ".avs", True)
       fa.WriteLine "a = BassAudioSource(" & Chr(34) & fe & Chr(34) & ")"
       fa.WriteLine "fl = GetChannel(a, 1)"
       fa.WriteLine "fr = GetChannel(a, 2)"
       fa.WriteLine "b = BassAudioSource(" & Chr(34) & fe2 & Chr(34) & ")"
       fa.WriteLine "c = GetChannel(b, 1)"
       fa.WriteLine "lfe = GetChannel(b, 2)"
       fa.WriteLine "d = BassAudioSource(" & Chr(34) & fe3 & Chr(34) & ")"
       fa.WriteLine "sl = GetChannel(d, 1)"
       fa.WriteLine "sr = GetChannel(d, 2)"
       fa.WriteLine "MergeChannels(fl, fr, c, lfe, sl, sr)"
       fa.Close
' write lines in batch file
       If bat = 0 then
          bepipe = bepipe & " --script " & Chr(34) & "Import(^"
          Set fg = fso.CreateTextFile(pre & ".bat", True)
       End if
       bat = bat + 1
       bepip2 = bepipe & pre & ".avs^)" & Chr(34) & " | "
       bepip2 = bepip2 & aften & opts & Chr(34) & pre & ".ac3" & Chr(34)
       fg.WriteLine bepip2
       bepip2 = "del " & Chr(34) & pre & ".avs" & Chr(34)
       fg.WriteLine bepip2
      End If
     End If
    End If
  End If
Next
if bat > 0 then
  fg.Close
  MsgBox "Finish. Run the batch file.", vbInformation, title
else
  MsgBox "Don't found sources.", vbInformation, title
End If
WScript.Quit
Edit: Added line:
bepipe = Chr(34) & bepipe & CHR(34)

Last edited by tebasuna51; 29th July 2006 at 10:55.
tebasuna51 is offline   Reply With Quote