Skip to content

Commit

Permalink
Update scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
ThreeDeeJay committed Jan 21, 2025
1 parent da32a61 commit 7607dfc
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 9 deletions.
11 changes: 6 additions & 5 deletions Convert to OpenAL Soft MHR.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ If defined HRTF (
Set Path=%~2!HRTF!
Echo.
Echo  !HRTF! 
If "%~x1"==".sofa" ("%~dp0Resources\Tool\sofa-info\sofa-info.exe" "%~1")
If defined Frequencies (
FOR %%f IN (!Frequencies!) DO (
Set Frequency=%%f
Expand Down Expand Up @@ -142,11 +143,11 @@ If defined MHR (
Echo If there's already a alsoft.ini application/game in the game folder, you'll need to manually set default-hrtf=!MHR!
Pause>Nul
If not exist "%APPDATA%\alsoft.ini" (Copy /y Nul "%APPDATA%\alsoft.ini" >Nul)
Call :EditINI "%APPDATA%\alsoft.ini" "General" "channels" "stereo"
Call :EditINI "%APPDATA%\alsoft.ini" "General" "stereo-mode" "headphones"
Call :EditINI "%APPDATA%\alsoft.ini" "General" "hrtf" "true"
Call :EditINI "%APPDATA%\alsoft.ini" "General" "hrtf-mode" "full"
Call :EditINI "%APPDATA%\alsoft.ini" "General" "default-hrtf" "!MHR!"
Call :EditINI "%APPDATA%\alsoft.ini" "General" "channels" "stereo"
Call :EditINI "%APPDATA%\alsoft.ini" "General" "stereo-mode" "headphones"
Call :EditINI "%APPDATA%\alsoft.ini" "General" "hrtf" "true"
Call :EditINI "%APPDATA%\alsoft.ini" "General" "stereo-encoding" "hrtf"
Call :EditINI "%APPDATA%\alsoft.ini" "General" "default-hrtf" "!MHR!"
) else (
Echo Press any key to close this window.
Pause>Nul
Expand Down
10 changes: 6 additions & 4 deletions Convert to X3DAudio HRTF MHR.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,9 @@ Set OutputFormat=.mhr
Set Input=%*
Set Renderer=X3DAudio HRTF
Set DiffuseFieldEqualization=on
SET Frequencies=22100,44100,48000
::Leave empty to disable resampling and preserve original sample rate.
SET Frequencies=8000,11000,11025,11100,12000,16000,18000,20000,22000,22050,22100,24000,28000,32000,44100,48000,96000
::SET Frequencies=44100
::If you notice any sounds playing loudly and non-spatialized (besides music), close the game and check the log to see if/which sample rate is missing and add it to the list above

:Start
PushD "%~dp0"
Expand Down Expand Up @@ -88,7 +89,8 @@ If defined HRTF (
FOR %%f IN (!Frequencies!) DO (
Set Frequency=%%f
If not exist "%~2!HRTF!\" (MkDir "%~2!HRTF!\")
Call :makehrtf -r !Frequency! -e !DiffuseFieldEqualization! -s !DiffuseFieldEqualization! -i "%~1" -d dataset -o "%~2!HRTF!\!HRTF!-!Frequency!!OutputFormat!"
REM Call :makehrtf -m -r=!Frequency! -i="%~1" -d=sphere -o="%~2!HRTF!\!HRTF!-!Frequency!!OutputFormat!"
Call :makehrtf -r !Frequency! -i "%~1" -d sphere -o "%~2!HRTF!\!HRTF!-!Frequency!!OutputFormat!"
If exist "%~2!HRTF!\!HRTF!-!Frequency!!OutputFormat!" (
Echo + Generated in: %~2!HRTF!\!HRTF!-!Frequency!!OutputFormat!
Call :Install "%~2!HRTF!\!HRTF!-!Frequency!!OutputFormat!"
Expand Down Expand Up @@ -122,7 +124,7 @@ EXIT /B
:Finish
Echo.
If exist "!Path!\hrtf" (
Echo Press any key to open folder to copy the !OutputFormat! files into the hrtf folder next to x3daudio1_7.dll ^(requires restarting application/game^)
Echo Press any key to open output folder containing the !OutputFormat! files to copy into the hrtf folder next to x3daudio1_7.dll ^(first delete the old MHR files. also, using requires restarting application/game^)
Pause>Nul
Start "%WINDIR%\explorer.exe" "!Path!\hrtf"
) else (
Expand Down
8 changes: 8 additions & 0 deletions Record and generate HeSuVi WAV.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,14 @@ SetLocal EnableDelayedExpansion

Set Normalization=-6

Color 6
Echo WARNING: This tool is VERY EXPERIMENTAL.
Echo It may generate empty/silent HRIRs because of a bug in the audio capture tool, which may lead to Blue Screen Of Death.
Echo So proceed with caution and remember to open the WAV in Audacity to make sure it's not completely empty before using it.
Pause
color 7


:Start
PushD "%~dp0"
ClS
Expand Down

0 comments on commit 7607dfc

Please sign in to comment.