Skip to content
Snippets Groups Projects
Commit 368c0735 authored by Conrad Zelck's avatar Conrad Zelck
Browse files

feat: enable 24 bit encoding


Tool is designed to upload wav to media grid. There are 16 bit only
allowed. But now you can suffix "24" to script name and it will convert
to 24 bit automatically.

Signed-off-by: default avatarConrad Zelck <git@simpel.cc>
parent eec5554f
No related branches found
Tags 1.1.0.23
No related merge requests found
......@@ -3,7 +3,7 @@
#AutoIt3Wrapper_UseX64=n
#AutoIt3Wrapper_Res_Comment=Converting to wav with 48kHz 16bit.
#AutoIt3Wrapper_Res_Description=Converting to wav with 48kHz 16bit.
#AutoIt3Wrapper_Res_Fileversion=1.1.0.22
#AutoIt3Wrapper_Res_Fileversion=1.1.0.23
#AutoIt3Wrapper_Res_Fileversion_AutoIncrement=p
#AutoIt3Wrapper_Res_CompanyName=Norddeutscher Rundfunk
#AutoIt3Wrapper_Res_LegalCopyright=Conrad Zelck
......@@ -33,6 +33,9 @@ GUICtrlCreateLabel("Analyse...", 20, 20, 130, 30)
GUICtrlSetFont(-1, 14, 400, 0, "Lucida Sans Typewriter")
GUISetState()
Global $g_24bit = False ; for Ingest it is necessary to have 16 bit; that is default; when really pro have '24' in script name
If StringInStr(@ScriptName, "24") Then $g_24bit = True
Opt("GUICloseOnESC", 0)
FileInstall('K:\ffmpeg\bin\ffmpeg.exe', @TempDir & "\ffmpeg.exe", $FC_OVERWRITE)
Local $sPathFFmpeg = @TempDir & "\"
......@@ -130,8 +133,13 @@ For $i = 1 To $aFileList[0]
GUICtrlSetData($idLabelFileName, $i & "/" & $aFileList[0] & ": " & _FileName($sCurTrack))
$iDelimiter = StringInStr($sCurTrack, ".", 0, -1)
$sCurTrackMinusExt = StringLeft($sCurTrack, $iDelimiter - 1)
$sCurTrackNewExt = '_48kHz_16bit.wav'
$sCommand = '-i "' & $sCurTrack & '" -c:a pcm_s16le -ar 48000 -y "' & $sCurTrackMinusExt & $sCurTrackNewExt & '"'
If $g_24bit Then
$sCurTrackNewExt = '_48kHz_24bit.wav'
$sCommand = '-i "' & $sCurTrack & '" -c:a pcm_s24le -ar 48000 -y "' & $sCurTrackMinusExt & $sCurTrackNewExt & '"'
Else
$sCurTrackNewExt = '_48kHz_16bit.wav'
$sCommand = '-i "' & $sCurTrack & '" -c:a pcm_s16le -ar 48000 -y "' & $sCurTrackMinusExt & $sCurTrackNewExt & '"'
EndIf
_runFFmpeg('ffmpeg ' & $sCommand, $sPathFFmpeg)
GUICtrlSetData($g_idProgress, 100) ; if ffmpeg is done than set progress to 100 - sometimes last StderrRead with 100 is missed
Next
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment