Skip to content

Commit 0185c4a

Browse files
authored
[build][windows] Add PortAudio to Windows generate_solution.pl (kaldi-asr#4026)
* Add portaudio build instructions. Need to test on a clean kaldi pull. * Correct location of portaudio.props * Small edit to INSTALL.md * Fix portaudio directory * Change paths back to match readme
1 parent ec83d38 commit 0185c4a

File tree

4 files changed

+42
-0
lines changed

4 files changed

+42
-0
lines changed

windows/INSTALL.md

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,15 @@ In the directory `build64`, find the file `openfst.sln` and open it using Visual
8181

8282
If either of the two won't build, you should stop here and start figuring what's different!
8383

84+
## Compiling PortAudio
85+
1. Download PortAudio from http://www.portaudio.com/download.html and extract the folder
86+
2. (Optional) Add ASIO Support: http://www.steinberg.net/en/company/developer.html
87+
3. Open an instance or Powershell or Command Prompt, navigate to the portaudio directory and type:
88+
$ cmake -G "Visual Studio 15 2017 Win64"
89+
4. CMake will generate a portaudio.sln in the directory. Open it
90+
5. Right click portaudio_static->Properties->C/C++->Code Generation->Runtime Library Change from Multi-Threaded Debug (/MTd) to Multi-threaded Debug DLL (/MDd)
91+
6. Build
92+
8493
## Compiling Kaldi
8594

8695
1. Checkout Kaldi trunk, using [git](https://git-for-windows.github.io/) from https://github.com/kaldi-asr/kaldi.git

windows/generate_solution.pl

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,7 @@
8585
"$Bin/openfstwin_release.props",
8686
"$Bin/openfstwin_debug_win32.props",
8787
"$Bin/openfstwin_release_win32.props",
88+
"$Bin/portaudio.props",
8889
);
8990

9091
my %optionalProps = (
@@ -534,6 +535,7 @@ sub writeProjectFiles {
534535
print PROJ
535536
" <Import Project=\"..\\kaldiwin_win32.props\" />
536537
<Import Project=\"..\\openfstwin_debug_win32.props\" />
538+
<Import Project=\"..\\portaudio.props\" />
537539
</ImportGroup>
538540
<ImportGroup Condition=\"'\$(Configuration)|\$(Platform)'=='Debug|x64'\" Label=\"PropertySheets\">
539541
<Import Project=\"..\\variables.props\" />
@@ -547,6 +549,7 @@ sub writeProjectFiles {
547549
print PROJ
548550
" <Import Project=\"..\\kaldiwin.props\" />
549551
<Import Project=\"..\\openfstwin_debug.props\" />
552+
<Import Project=\"..\\portaudio.props\" />
550553
</ImportGroup>
551554
<ImportGroup Condition=\"'\$(Configuration)|\$(Platform)'=='Release|Win32'\" Label=\"PropertySheets\">
552555
<Import Project=\"..\\variables.props\" />
@@ -560,6 +563,7 @@ sub writeProjectFiles {
560563
print PROJ
561564
" <Import Project=\"..\\kaldiwin_win32.props\" />
562565
<Import Project=\"..\\openfstwin_release_win32.props\" />
566+
<Import Project=\"..\\portaudio.props\" />
563567
</ImportGroup>
564568
<ImportGroup Condition=\"'\$(Configuration)|\$(Platform)'=='Release|x64'\" Label=\"PropertySheets\">
565569
<Import Project=\"..\\variables.props\" />
@@ -573,6 +577,7 @@ sub writeProjectFiles {
573577
print PROJ
574578
" <Import Project=\"..\\kaldiwin.props\" />
575579
<Import Project=\"..\\openfstwin_release.props\" />
580+
<Import Project=\"..\\portaudio.props\" />
576581
</ImportGroup>
577582
";
578583

windows/portaudio.props

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
<?xml version="1.0" encoding="utf-8"?>
2+
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
3+
<PropertyGroup>
4+
<_ProjectFileVersion>10.0.30319.1</_ProjectFileVersion>
5+
<LinkIncremental>
6+
</LinkIncremental>
7+
</PropertyGroup>
8+
<ItemDefinitionGroup>
9+
<ClCompile>
10+
<AdditionalIncludeDirectories>$(PORTAUDIO)\src\common;$(PORTAUDIO)\src\os\win;$(PORTAUDIO)\include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
11+
</ClCompile>
12+
<Link>
13+
<AdditionalLibraryDirectories>$(PORTAUDIOLIB);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
14+
<AdditionalDependencies>portaudio_static_x64.lib;%(AdditionalDependencies)</AdditionalDependencies>
15+
</Link>
16+
</ItemDefinitionGroup>
17+
</Project>

windows/variables.props.dev

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,8 @@
99
<OPENFST>C:\Users\jtrmal\Documents\openfst\</OPENFST>
1010
<OPENFSTLIB>C:\Users\jtrmal\Documents\openfst\build64</OPENFSTLIB>
1111
<CUBDIR>c:\Users\jtrmal\Documents\cub\</CUBDIR>
12+
<PORTAUDIO>W:\kaldi-build\portaudio_src_double</PORTAUDIO>
13+
<PORTAUDIOLIB>W:\kaldi-build\portaudio_src_double\Debug</PORTAUDIOLIB>
1214
<NVTOOLSDIR>C:\Program FIles\NVIDIA Corporation\NvToolsExt\</NVTOOLSDIR>
1315
<!-- Do not modify anything after this line -->
1416
</PropertyGroup>
@@ -35,9 +37,18 @@
3537
<Value>$(CUBDIR)</Value>
3638
<EnvironmentVariable>true</EnvironmentVariable>
3739
</BuildMacro>
40+
<BuildMacro Include="PORTAUDIO">
41+
<Value>$(PORTAUDIO)</Value>
42+
<EnvironmentVariable>true</EnvironmentVariable>
43+
</BuildMacro>
44+
<BuildMacro Include="PORTAUDIOLIB">
45+
<Value>$(PORTAUDIOLIB)</Value>
46+
<EnvironmentVariable>true</EnvironmentVariable>
47+
</BuildMacro>
3848
<BuildMacro Include="NVTOOLSDIR">
3949
<Value>$(NVTOOLSDIR)</Value>
4050
<EnvironmentVariable>true</EnvironmentVariable>
4151
</BuildMacro>
4252
</ItemGroup>
4353
</Project>
54+

0 commit comments

Comments
 (0)