Skip to content

Instantly share code, notes, and snippets.

@SteveALee
Last active October 1, 2024 16:26
Show Gist options
  • Save SteveALee/da24c2be633340b8791066dd98eb5d0b to your computer and use it in GitHub Desktop.
Save SteveALee/da24c2be633340b8791066dd98eb5d0b to your computer and use it in GitHub Desktop.
Build audacity with ASIO support on Windows

Build your own Audacity for Windows with ASIO driver support

You might want Audacity to work with the ASIO drivers supplied with your sound devices. Commmon reasons for this are:

  • Only ASIO drivers are available for your hardware (eg Behringer mixers)
  • Performance - ASIO has low latency (delays)
  • You don't want to use the ASIO4All bridging driver with non ASIO drivers
  • Multi channel support - though Audacity is not so good at handling other than Stereo or Mono

Due to licensing restrictions the Audacity team cannot provide a prebuilt version with Windows ASIO driver support. But with this guide and script you can easily build your own Audacity with ASIO support.

This builds the latest Audacity release 3.6.3 by default. Recent other versions can be built with the -v option

ko-fi

Background

Drivers are the glue between an audio program like Audacity and external hardware like a mixer or sound interface. The drivers usually used on Windows have limitations which can be overcome if you use ASIO drivers for your hardware. Specifically, low latency (delay) and multi channel support are available with ASIO drivers.

The Audacity program is the "go to" solution for many audio recording and editing tasks. However, unlike many more advanced DAWs, it doesn't support Windows ASIO drivers "out of the box". Fortunately, Audiacity's standard MME support is fine for most uses. That said, common reasons for needing ASIO include using digital audio or music equipment that only comes with ASIO drivers, such as Behringer mixers (which actually suggest using the less efficient ASIO4ALL ASIO to WDM bridging driver). Another common reason is to take advantage of the low latency or multiple channels supported by ASIO. Note that Audacity really is not a good multichannel solution, so if that is required a DAW might be a better bet.

While it is possible to build your own Audacity with ASIO support by following the instructions this usually requires considerable technical skills.

But have no fear, the instructions and script provided here make it easy to build your own version of Audacity with ASIO support. You just need a suitable Windows PC. The script installs all required tools and builds a 64 bit release version of Audacity with ASIO for you using the official build instructions.

NB. If you do use this to build Audacity with ASIO support you must not redistribute it due to the ASIO SDK licensing terms - see below.

Here's a brief blog post explaining why I needed ASIO and it includes a screen shot. But note, since writing that, I discovered my McMillen K-Mix digital interface mixer facilities alow routing of inputs 3 & 4 to the main outputs on 1 and 2 so can use the default MME Audacity build after all. For playback from PC, I found the HiFi Driver and ASIO Bridge from VB Audio lets me re-route PC audio out to channels 3 & 4 on the K-Mix, Leaving Channels 1 & 2 free for instruments and Mics.

Licensing

The reason for Audacity's lack of ASIO support is licensing, not technical. Steinberg do not alow the ASIO SDK to be redistributed (as required by open source projects). In addition, Audacity is GPL licensed and so is incompatible with the ASIO SDK licence redistribution rules.

Development PC

The script installs a set of development tools that are known to build Audacity. Due to the complex nature of such tools, any other versions of them on your PC may interfere with this script. Thus this scipt should be run on a clean PC without any developer tools. No support can be offered otherwise.

If you would rather not install these tools (Git for Windows, Visual Studio, CMake, Python and Conan), or you already have versions of them or even if you are having build problems, you can use a one of the following Vitual Machines:

  • Windows Sandbox - Sandbox can be enabled on Windows 10/11 Pro/Enterprise and can also be installed on Windows Home with a bit of effort. If the build experiences memory errors you will need a configuration file to provide more memory than the default 4GB.
  • A virtualisation program - install a VM and and a matching Developer Virtual Machine Image from Microsoft. In most cases VirtualBox will be a good choice (import the Microsoft supplied .ova appliance file but the Visual Studio pre installed in the VM must be uninstalled first to avoid problems).

In both cases you can copy the built files to where they will be run from on you PC file system, possibly by sharing a PC folder with the VM.

Step by Step Instructions

  • Ensure you have a PC (or VM) with Windows 10 or 11 installed.
  • Make a new folder C:\projects.
  • Click on the 'raw' button at the top of the script (below) in this Gist.
  • Use the browser Save As (right click) feature to save the script as This PC -> C:\projects\build-audacity.cmd. To avoid it being saved as a text file type the filename in quotes, eg "build-audacity.cmd".
  • open a new Windows cmd terminal (Windows + R keys and then type cmd)
  • Type cd \projects and enter key.
  • Install required tools and build by typing build-audacity.cmd and enter (use -v3.3.3 if requred).
    • Follow the prompts, pressing a key to start each tool's installer (when previous has finished).
    • NB for Visual Studio, make sure you check the "desktop development with C++" workload
    • If you have a non English Windows or Visual Studio then you must also install the English language packs.
  • Come back later - it will take at least 10 minutes.
  • Audactiy will be launched to test it was built correctly.
    • See the program location printed out at the end of the build so you can run it again.
    • Optionally copy the specified folder to where you want to run Audacity from, optionally renaming it.

(This video by @Renamesk walks you through the process, but the tool installation method has changed.)

If you have any ASIO drivers installed for active connected hardware you should find ASIO is now available in the the Audacity driver selection combo box which probably currently shows 'MME' selected (you may need to show using menu item View -> Toolbars -> Device toolbar).

NB: The Audacity settings and preferences are stored in a folder "Portable Settings" next to the audacity program. If you want to use settings in the user's home directory then delete this folder.

ko-fi

When things go wrong

As with any complex software build there are many moving parts (including Windows itself) and things can sometimes go wrong. Here are some tips if you hit build errors.

If everyhting falls or you just want to shortcut lots of painful debugging then try a Microsoft Windows Virtual machine (VM) as mentioned above.

  • make sure you have latest script
  • make sure you are in a folder C:\projects in the cmd window
  • ensure you are an administrator on your Windows 10 or 11 64 bit PC (ie not a organisational PC)?
  • run the script with --cleanall and try again
  • uninstall all the tools and installers (Python, cmake, Visual Studio) and then reboot before trying again
    • note having other versions of any of the tools installed may well cause problems - remove them
  • ensure you ticked the specified options when installing Visual Studio and Python, reinstall if unsure
  • read the error output - clues are often buried in reams of impenetrable text
  • disable any Anti Virus - the built-in Microsoft one is usually not a problem
  • if your PC is not English make sure you have EN language packs installed for Windows and VS

Thanks

  • @diogodh for finding and fixing the bug with conan installations
  • The Audacity team for an fantastic audio tool

ko-fi

@echo off
rem Version: 2.9.0
rem
rem Build audacity with ASIO support on Windows
rem See the following gist for details
rem https://gist.github.com/SteveALee/da24c2be633340b8791066dd98eb5d0b
rem
rem Options (only one may be specified)
rem
rem --install or none - install tools and build
rem --build - build, no install
rem --noget - build only but don't fetch again from git
rem --getonly - only get the files
rem --rebuild - cleanall and build
rem --clean - remove built files
rem --cleanall - remove fetched, built files and conan modules
rem --cleaninstall - remove downloaded installation files
rem -vj.m.p version - default is 3.6.4 (using conan 2.3.2) - limited due to dependencies
rem
rem MIT licence
rem steve@fullmeasure.co.uk
TITLE Build Audacity with ASIO
setlocal
rem Clean up arguments
set TARGET=%1
set VERSION=%2
rem substring on empty var fails within parenthesis
if not [%TARGET%] == [] set TARGET_PREFIX=%TARGET:~0,2%
if [%TARGET_PREFIX%] == [-v] (
set TARGET=%2
set VERSION=%1
)
if [%TARGET%] == [] set TARGET=--install
if [%VERSION%] == [] (
set AUDACITY_REL=3.6.4
) else (
set AUDACITY_REL=%VERSION:~2%
)
set VISUALSTUDIOVER=2022\Community
set VISUALSTUDIOCMAKE=Visual Studio 17 2022
set VSDIR=%ProgramFiles%\Microsoft Visual Studio\%VISUALSTUDIOVER%
set PROJROOT=C:\projects
set AUDACITY=%PROJROOT%\audacity
set AUDACITY_BUILD=%PROJROOT%\audacity-asio
set MAKE_CONFIG=RelWithDebInfo
set EXEDIR=%AUDACITY_BUILD%\%MAKE_CONFIG%
set INSTALLFILEDIR=bin
rem More vaiables set for --install
if [%AUDACITY_REL:~0,3%] == [3.3] (set CONAN_VER=1.59.0) else (set CONAN_VER=2.3.2)
set CMAKE_OPTS=-DAUDACITY_BUILD_LEVEL=2 -Daudacity_has_asio_support=On
if [%AUDACITY_REL:~0,3%] == [3.5] set CMAKE_OPTS=%CMAKE_OPTS% -Daudacity_has_audiocom_upload=On -Daudacity_has_networking=On -Daudacity_has_url_schemes_support=On
if [%AUDACITY_REL:~0,3%] == [3.6] set CMAKE_OPTS=%CMAKE_OPTS% -Daudacity_has_audiocom_upload=On -Daudacity_has_networking=On -Daudacity_has_url_schemes_support=On
rem check projroot exists
if /I not [%~dp0] == [%PROJROOT%\] (
echo.
echo Error: This script must be run in %PROJROOT% - see %%PROJROOT%% in file
echo.
if not exist %PROJROOT% (
echo Create %PROJROOT
goto exit
) else (
echo cd to %PROJROOT%
goto exit
)
)
echo.
echo Building Audacity %AUDACITY_REL% 64 bit RelWithDebInfo with ASIO support...
echo.
rem Get tools
rem ANSI escape sequences do not work in if () block so we use goto
set git-url=https://github.com/git-for-windows/git/releases/download/v2.45.2.windows.1/Git-2.45.2-64-bit.exe
set GITPATH=%ProgramFiles%\Git\cmd\
set vs2022-url=https://aka.ms/vs/17/release/vs_community.exe
rem Conan is installed later
if [%CONAN_VER%] == [1.59.0] (
rem Note Conan 1.59 has dependency issues with python 3.12
set python-url=https://www.python.org/ftp/python/3.11.0/python-3.11.0-amd64.exe
set PYTHONPATH=%LOCALAPPDATA%\Programs\Python\Python311\
) else (
set python-url=https://www.python.org/ftp/python/3.12.4/python-3.12.4-amd64.exe
set PYTHONPATH=%LOCALAPPDATA%\Programs\Python\Python312\
)
set PIPPATH=%PYTHONPATH%Scripts\
if not [%TARGET%] == [--install] if not [%TARGET%] == [--cleaninstall] goto clean
if [%TARGET%] == [--cleaninstall] echo Cleaning installation files... & rmdir /s/q %INSTALLFILEDIR% 2> :null & goto exit
echo   
echo.
echo Fetching tools..
echo 
mkdir %INSTALLFILEDIR% 2> :null
curl -L %git-url% -o %INSTALLFILEDIR%\g4w.exe
curl -L %vs2022-url% -o %INSTALLFILEDIR%\vs.exe
curl -L %python-url% -o %INSTALLFILEDIR%\python.exe
echo   
echo.
echo Installing tools...
echo.
echo IMPORTANT!! Follow the instructions below for each installer
echo Close each installer when it is done before starting next
echo.
echo Git for Windows
echo Choose the option "Git from the command line..."
pause
%INSTALLFILEDIR%\g4w.exe
echo.
echo Visual Studio: make sure you select the Workload "Desktop development with C++"
echo You can uncheck "Start After installation"
pause
%INSTALLFILEDIR%\vs.exe
echo.
echo Python: make sure you select "Add python.exe to PATH" for future access
pause
%INSTALLFILEDIR%\python.exe
echo.
echo.
echo 
set installing=true
call :clean --rebuild
goto exit
rem subroutine
:cleanall
echo Cleaning source and built files... & rmdir /s/q %AUDACITY% %AUDACITY_BUILD% 2> :null
where /q conan & if ERRORLEVEL 0 echo Cleaning conan cache... & conan remove -c "*" 2>&1 > :null
exit /B
:clean
rem Python is on path, unless in windows sandbox
rem where /q python & if ERRORLEVEL 1 path %PATH%;%PYTHONPATH%
rem where /q pip & if ERRORLEVEL 1 path %PATH%;%PIPPATH%
rem where /q git & if ERRORLEVEL 1 path %PATH%;%GITPATH%
path %PYTHONPATH%;%PIPPATH%;%GITPATH%;%PATH%
if not [%TARGET%] == [--getonly] (
if /I [%TARGET%] == [--clean] echo Cleaning built files... & rmdir /s/q %AUDACITY_BUILD% 2> :null & goto exit
if /I [%TARGET%] == [--cleanall] call :cleanall & goto exit
if /I [%TARGET%] == [--rebuild] call :cleanall
)
rem Launch cmake-gui
rem VS doesn't include this with it's cmake
rem if [%TARGET%]==[--gui] cmake-gui -Daudacity_has_asio_support=On %CMAKE_OPTS% -S %AUDACITY% -B %AUDACITY_BUILD% & goto build
:checktools
rem ensure tools are installed
if not [%TARGET%] == [--noget] (
where /q git & if ERRORLEVEL 1 echo Git for Windows does not appear to be installed. Re run with "--install" & goto exit /b
)
if not [%TARGET%] == [--getonly] (
if not exist "%VSDIR%\VC\Auxiliary\Build\vcvars64.bat" echo Visual Studio does not appear to be installed. Re run with "--install" & goto exit /b
if not defined VisualStudioVersion call "%VSDIR%\VC\Auxiliary\Build\vcvars64.bat"
where /q python & if ERRORLEVEL 1 echo Python does not appear to be installed. Open a new cmd window or re-run with "--install" & goto exit /b
where /q conan & if ERRORLEVEL 0 pip show --version conan | findstr /R /C:"Version: %CONAN_VER%" & if ERRORLEVEL 1 echo conan %CONAN_VER% not found & pip uninstall -y -q conan
where /q conan & if ERRORLEVEL 1 echo installing conan %CONAN_VER% & pip install conan==%CONAN_VER%
)
rem Get source code
:getcode
if /I not [%TARGET%] == [--clean] (
if /I not [%TARGET%] == [--cleanall] (
if /I not [%TARGET%] == [--noget] (
echo Fetching code for Audacity %AUDACITY_REL%...
echo.
git clone -b Audacity-%AUDACITY_REL% --depth 1 https://github.com/audacity/audacity/ %AUDACITY%
if ERRORLEVEL 1 echo Error: cannot fetch the Audacity code. Try the --cleanall or --noget options & goto exit
)
)
)
if /I [%TARGET%] == [--getonly] goto exit
if not exist %AUDACITY%\CMakeLists.txt echo The code files appear to be missing from %AUDACITY%. & goto exit
:cmake
cd %AUDACITY%
cmake.exe -G "%VISUALSTUDIOCMAKE%" -DCMAKE_CONFIGURATION_TYPES=%MAKE_CONFIG% %CMAKE_OPTS% -S %AUDACITY% -B %AUDACITY_BUILD% & if ERRORLEVEL 1 echo Error: Cannot create Audacity buildfiles & goto exit
:build
cd %AUDACITY_BUILD%
set msbuild="%VSDIR%\MSBuild\Current\Bin\MsBuild.exe"
%msbuild% ALL_BUILD.vcxproj -p:configuration=%MAKE_CONFIG%
if ERRORLEVEL 1 echo Error: cannot build Audacity & goto exit
rem Settings stored with files rather than home directory
rem See https://manual.audacityteam.org/man/portable_audacity.html
mkdir %EXEDIR%\"Portable Settings"
cd %PROJROOT%
rem All done
echo 
echo.
echo Congratulations!
echo Your new Audacity %AUDACITY_REL% with ASIO support will now launch.
echo The ASIO options will appear if you have ASIO drivers and connected hardware
echo In future just run the audacity.exe. No need to install.
echo.
echo %EXEDIR%\audacity.exe
echo.
echo Or copy the folder
echo.
echo %EXEDIR%\
echo.
echo and run the included audacity.exe
echo.
echo Note settings and preferences are stored in "%EXEDIR%\Portable Settings"
echo If you want to use settings in the user's home directory then delete this folder.
echo.
echo 
start %EXEDIR%\audacity.exe
if defined installing exit /B
:exit
cd %PROJROOT%
endlocal
@haberl333
Copy link

Thanks for this quick answer. I just found a solution/workaround. Up till Version 3.4.0 alpha it was sufficient, to copy all files from release directory in my VM to any directory in my main machine, add subdir Portable Settings to get a new portable version (I cannot bring myself to delete old running versions). And that is the problem with the latest builds like you mentioned. To workaround this I installed an official Audacity without ASIO (exactly same version!) and then copied all the self builded files on it, and voila I found Libraries command again. Moreover I copied all the files of the official install directory in c:\program files\audacity... back to my personal local directory with Portable Settings subdir included and also this version now works well...

Nevertheless many thanks for your build-command file, and I hope you will find time for future updates .

BTW: I also had problems in the beginning with version 3.4.0. And I solved it, by cleaning my VM from my Visual Studio Community version included C# support.

@SteveALee
Copy link
Author

Hmm thanks. It was always possible to copy the built version files without officially making in any sort of portable app. Seems I need to dig. Progress hey!?

@SteveALee
Copy link
Author

SteveALee commented Nov 19, 2023

Yeah, I suggested removing provided VS in windows dev VM as is an unknown.

@SteveALee
Copy link
Author

Updated script to build all components including plugins for FFmpeg etc. Also creates the "Portable Settings" folder for preferences.

Thanks @haberl333 and Ed Witles for helping to identify and fix the issue.

@SteveALee
Copy link
Author

[Update] Version: 2.4.0 of script now installs Git for Windows. Also better at updating path on install.

@rhcaldwell
Copy link

Truly a labor of love, thanks for doing it. I’m going to give it a shot.

@SteveALee
Copy link
Author

@rhcaldwell definitely made with love and quite a bit of labour given windows cmd script! Lol. It usually just works. Good luck.

@GrumpyOldDrummer
Copy link

Hi Steve, I appreciate all the work you have done to generate the script. Thank You. You've more than earned my Kofi. Unfortunately I'm having some problems getting the script v 2.4.0 to work. I don't have the skills to fix it and I'm hoping you can give me some pointers please.
I'm running the script in Sandbox on a Win 11 laptop and aiming to build Audacity v 3.4.2 with ASIO. The first problem I hit was when it got to the build stage it halted on error "Python does not appear to be installed...". I had definitely ticked the 'Add python.exe to path' box and left the other installation options at the defaults. When I checked I found that python.exe, gw4.exe and vs.exe had all been installed in c:\projects\bin. So from an elevated cmd prompt I added that directory to the path and ran the script with "--build". It ran but produced over 100 warnings and over 330 errors and then reported 'unable to build Audacity. I repeated the process a few times to be sure I'd followed the instructions correctly but with the same results. I'd appreciate any pointers.

Then I tried to set the python install directory to C:\programs when the install window came up.. The installer still put it in C:\bin.

I'm guessing this is a Sandbox problem that the script can't fix and I need to try another VM?

Regards
Alan

@SteveALee
Copy link
Author

SteveALee commented Feb 15, 2024

@GrumpyOldDrummer (love the name) oh dear. I've not tried the sandbox for a while so will test again. The script might not need python to be on the path now - it uses relative paths - or it should. But you made a good call in trying to fix. I'll try on a really clean PC to check. Sorry for the problems.

@SteveALee
Copy link
Author

@GrumpyOldDrummer oh shoot I don't have windows pro around anymore as didn't need the extra features to justify extra cost. I have an old windows 10 PC I can try.

@SteveALee
Copy link
Author

@GrumpyOldDrummer OK I made small change to compensate for different Python installer behaviour in a Sandbox. Download the new script, uninstall Python and try a full install again (you can cancel the git and VS installs).

@GrumpyOldDrummer
Copy link

GrumpyOldDrummer commented Feb 15, 2024 via email

@GrumpyOldDrummer
Copy link

It worked! Thanks Steve. When I first ran it I got several hundred of out-of-memory errors. I understand the sandbox memory defaults to 4GB so I increased that arbitrarily to 10GB by creating a .wsb file and then it worked.

@SteveALee
Copy link
Author

@GrumpyOldDrummer yay!

It just worked on my clean install Windows 11 Pro. But very slow and terminal font changed for the worse half way through.

Out of interest what will you be using ASIO with?

@GrumpyOldDrummer
Copy link

@SteveALee
The build ran cleanly on my laptop after your tweaks and the memory allocation increase. I will be using it with a Behringer UMC202HD on my laptop and with a RME UFX+ on my studio setup. I just tested it with the RME and it works perfectly. I normally run Cubase there but I've been using Audacity macros to process some old band cassette recordings from the 1980's.
Thanks again Steve. Top Man!

@SteveALee
Copy link
Author

@GrumpyOldDrummer nice, Behringer kit seems a common use case. The Audacity multi channel experience needs some work but latency will be better than the ASIO 4 All hack that's often proposed.

@SteveALee
Copy link
Author

Now builds 3.4.2 by default

@GrumpyOldDrummer
Copy link

@SteveALee
You are right that multi-channel record needs some work. I spoke too soon about it working perfectly with the RME. I cannot find a way to display and record on selected channels only. i.e. If I want to record channels 11 and 12 only I have to select 12 inputs channels. It puts all 12 on the screen and records on 11 and 12. If I hide the unused channels it doesn't record on 11 and 12. Sigh... Playback is fine. All is fine with the 2 channel Behringer box.

@SteveALee
Copy link
Author

Yeah, it sucks big time. One day if I get more time!.... In my notes in the gist I mention a little app that will route channels. It might help.

@SteveALee
Copy link
Author

@SimbaNL did you install the c++ as instructed for visual studio? Otherwise see the debug section above

@SteveALee
Copy link
Author

SteveALee commented Feb 22, 2024

@GrumpyOldDrummer just discovered VB Audio Matrix which might provide a partial workaround for Audacity's lack of multitrack usability,:

https://youtu.be/xKUrmkPB4iw?si=umEPxxFw1arg7kUa

I think it will let me use both of my interfaces without lots of config changes.

@GrumpyOldDrummer
Copy link

GrumpyOldDrummer commented Feb 22, 2024 via email

@SteveALee
Copy link
Author

SteveALee commented Mar 13, 2024

Now also builds 3.5.0-beta with audio.com support
Switched to RelWithDebInfo config as per Audacity releases

@Rhiannon81
Copy link

Rhiannon81 commented Apr 5, 2024

Hi, thanks for the great script. I'd like to suggest a few fixes and improvements.

First of all, installing gettext and iconv is required to build Audacity if you want to use it in another language, otherwise the strings in the UI will have encoding issues, and for some reason this will cause Audacity to crash when trying to record.
Weird that the build doesn't fail or give any warnings, but still.

I downloaded it from here: https://github.com/vslavik/gettext-tools-windows
Just make sure the contents of /bin are somewhere in your %PATH%.

A bit of a tangent here: about using Visual Studio in English, I remember it was due to a dependency that read the console to determine if the build was successful. Except it used a regex on the human readable string instead of looking at the error code. So if it was not English, it considered the build to have failed. I don't remember what this dependency was, I just remember that - quite a while ago - after a long search I finally found a bug report from years ago by an Italian user that explained what I just said, and the answer from the developers was basically WONTFIX. If you know what this dependency was and if it is still present in Audacity, I suppose you could mention it in the docs.

I would also like to suggest adding the ability to build the master branch.

Add this after line 54:
if [%AUDACITY_REL%] == [master] set CMAKE_OPTS=%CMAKE_OPTS% -Daudacity_has_audiocom_upload=On -Daudacity_has_networking=On -Daudacity_has_url_schemes_support=On

And change the git clone command like this

if not [%AUDACITY_REL%] == [master] git clone -b Audacity-%AUDACITY_REL% --recurse-submodules https://github.com/audacity/audacity/ %AUDACITY%
if [%AUDACITY_REL%] == [master] git clone -b %AUDACITY_REL% --recurse-submodules https://github.com/audacity/audacity/ %AUDACITY%

And one last thing, add the ability to build the installer. This will add Inno Setup 6 to the list of required software to be installed before building.
I just build the installer by default without any further switches, you may want to do it differently.
These are the commands:

:build
cd %AUDACITY_BUILD%
set msbuild="%VSDIR%\MSBuild\Current\Bin\MsBuild.exe"
%msbuild% ALL_BUILD.vcxproj -p:configuration=%MAKE_CONFIG%
if ERRORLEVEL 1 echo Error: cannot build Audacity & goto exit
%msbuild% PACKAGE.vcxproj -p:configuration=%MAKE_CONFIG% -p:Platform="x64"
if ERRORLEVEL 1 echo Error: cannot build Audacity & goto exit
%msbuild% innosetup.vcxproj -p:configuration=%MAKE_CONFIG% -p:Platform="x64"
if ERRORLEVEL 1 echo Error: cannot build Audacity & goto exit

The installer will be in %AUDACITY_BUILD%\innosetup\Output

Thanks again for this script, you saved me a lot of time.

Edited to add: I added the whole C:\projects folder to the exclusion list in Windows Defender, otherwise the build would sometimes fail complaining that %AUDACITY_BUILD%\innosetup\audacity.iss was inaccessible because it was being used by another process.
Further edited for grammar and formatting.

@SteveALee
Copy link
Author

@ Rhiannon81 thank you so much for your compliments and great contributions. Here's some very guick comments - I'll think more deeply too

  • gettext and iconv - I agree it is very weird if these are an optional dependency. I must admit I didn't think about internationalisation at all in any way (shame on me) and assumed the build just took it all in to account. This just uses the developer build instructions and they make no mention of internationalisation, perhaps as devs are expected to use English (hmmm). I'll raise this with the devs at some point in case there are more issues than you noticed.

Any ideas how I would test to check adding those deps worked? Does it require a language version of WIndows or a Lang pack?

  • master branch - as this is designed for users and so release builds only that never occurred as something that would be useful. I guess devs can easily hack the script - I do often ;) What is your use case here? I might add anyway. The problem is when the build chain changes the script gets much more complex, not just checking out the right branch. I'd rather just ensure latest few releases are buildable to be honest

  • Installer - interesting idea and I can see some might find it useful or preferable due to familiarity. Especially if wanting to deploy to another device (or VM) or multiple devices (unlikely). Much as I love Inno (I used it many year ago for a Powerpoint TTS app ), for local use only just using or copying the files like a portable app is fairly straight forward. As is s creating a shortcut (just right click) and works as there are no install time registry setup requirements. I'll probably add this soon as it does not harm (other than more code to maintain - lol).

  • Defender problems - Will definitely add that as a suggestion as I think I just turned it off for \Projects anyway for speed many moon ago. I never saw that error you had. Now I tend to just use Sandbox - though is quite slow.

Thanks again for these great suggestions!

@Rhiannon81
Copy link

Hi again.

If I remember correctly, the requirement for gettext and iconv was introduced somewhere during the alpha/beta development of version 3.3.0, in September 2022 I think. One day, building from master branch just started showing the symptoms I explained, and it took me quite a long time to understand what was wrong.

As for how to test for this kind of problem, unfortunately I have no idea.

I am using Visual Studio in English (I uninstalled all other language packs) because of my experience with that old dependency, but my Windows is not in English.

I actually have no particuar reason to build from master branch, I'm doing it just because. But yeah, I understand that all the problems I just talked about are very good reasons not to add the ability to build from master in your script.

And for the installer, again, it's just the convenience of copying just one file and then clicking install-next-finish, since I'm building in a VM.

@SteveALee
Copy link
Author

@Rhiannon81 can you at least give an example of how to get bad text without the extra dependencies. It sounds like I might need a non EN WIndows SKU though :( Thanks

To build master you could just "git clone" yourself then use the --noget script option. A bit fiddly I know.

@Rhiannon81
Copy link

@SteveALee I suppose that if gettext and iconv don't exist in your PATH you could just run Audacity and change the language in Preferences - Interface.

To give you an example, in Italian, the Attività menu shows up as AttivitÃ

I thought of something, I might be totally wrong though: if you do happen to have gettext and iconv in your path, how did they get there?
I thought maybe they used to be automatically installed with either git or python and at some point they weren't anymore?

@SteveALee
Copy link
Author

@Rhiannon81 Hmm, capitalisation of the A? Strange bug.

And there's the dev and user paths to think about. All a bit strange.

@SteveALee
Copy link
Author

SteveALee commented May 28, 2024

Tested Audacity 3.5.1
Updated conan to 2.3.2 so new VisualStudio 17.10.0 (msvc19.40) works

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment