Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 10 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,16 @@ Also see the [PortAudioBasic](samples/PortAudioBasic/src/PortAudioBasicApp.cpp)

### Enabling Windows ASIO backend

For ASIO support, download ASIO Sdk from the Steinberg website [here](https://www.steinberg.net/en/company/developers.html), unzip and move to a folder at `lib/ASIOSDK`.
For ASIO support on Windows, the simplest approach is to run the included `lib\install_msw_asio.ps1` from a Command Prompt:

Then make sure that the following preprocessor macro is defined in our project:
```
cd <Path to Cinder-PortAudio>
powershell lib\install_msw_asio.ps1
```

Alternatively, the following can be done by hand. Download the ASIO SDK from the Steinberg website [here](https://www.steinberg.net/en/company/developers.html), unzip, and move to a folder at `lib/ASIOSDK`.

Then make sure that the following preprocessor macro is defined in your project:

```
PA_USE_ASIO=1
Expand All @@ -49,7 +56,7 @@ lib/ASIOSDK/host/pc/asiolist.cpp

##### Enable Unicode Character Set

Most cinder projects are build with Unicode Character Set (Configuration Properties -> General -> Character Set) and to make ASIO compatible with this, you need to add the following line to the top of _lib/ASIOSDK/host/pc/asiolist.cpp_, directly above the <#include "windows.h>`:
Most Cinder projects are build with Unicode Character Set (Configuration Properties -> General -> Character Set) and to make ASIO compatible with this, you need to add the following line to the top of _lib/ASIOSDK/host/pc/asiolist.cpp_, directly above the `<#include "windows.h>`:

```
#undef UNICODE
Expand Down
20 changes: 20 additions & 0 deletions lib/install_msw_asio.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
if( ! (Test-Path "$PSScriptRoot\ASIOSDK2.3.2.zip" -PathType Leaf) ) {
Write-Host "Downloading ASIO SDK 2.3.2"
iwr -outf "$PSScriptRoot\ASIOSDK2.3.2.zip" http://www.steinberg.net/sdk_downloads/ASIOSDK2.3.2.zip
}

if( ! (Test-Path "$PSScriptRoot\ASIOSDK" -PathType Container) ) {
Write-Host "Unzipping to lib\ASIOSDK"
Expand-Archive "$PSScriptRoot\ASIOSDK2.3.2.zip" "$PSScriptRoot\temp"
Move-Item $PSScriptRoot\temp\ASIOSDK2.3.2 $PSScriptRoot\ASIOSDK
Remove-Item $PSScriptRoot\temp
Remove-Item $PSScriptRoot\ASIOSDK2.3.2.zip
}

$asiolistPath = "$PSScriptRoot\ASIOSDK\host\pc\asiolist.cpp"
if( !( Select-String -Pattern "#undef UNICODE" -Path $asiolistPath -Quiet ) ) {
Write-Host "Prepending `"#undef UNICODE`" to asiolist.cpp"
((Get-Content $asiolistPath -Raw) -replace "#include <windows.h>", "#undef UNICODE`r`n#include <windows.h>") | Set-Content -Path $asiolistPath
}

Write-Host "ASIO SDK downloaded and setup"