Skip to content

Commit

Permalink
audio args fix
Browse files Browse the repository at this point in the history
Signed-off-by: David Anyatonwu <[email protected]>
  • Loading branch information
onyedikachi-david committed Sep 9, 2024
1 parent 181a4e3 commit af56934
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
8 changes: 6 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -353,13 +353,17 @@ jobs:
# Construct the command arguments
$args = @("--data-dir", ".\test_data", "--fps", "1")
if ($env:TEST_AUDIO_DEVICE) {
$args += "--audio-device", $env:TEST_AUDIO_DEVICE
# Escape the audio device name to handle spaces and special characters
$escapedAudioDevice = """$($env:TEST_AUDIO_DEVICE)"""
$args += "--audio-device", $escapedAudioDevice
} else {
Write-Warning "TEST_AUDIO_DEVICE is not set. Running without --audio-device parameter."
}
# Start the process with the constructed arguments
$process = Start-Process -FilePath .\screenpipe.exe -ArgumentList $args -NoNewWindow -PassThru -RedirectStandardOutput .\test_data\logs\screenpipe_output.log -RedirectStandardError .\test_data\logs\screenpipe_error.log
$processArgs = $args -join ' '
Write-Output "Running command: .\screenpipe.exe $processArgs"
$process = Start-Process -FilePath .\screenpipe.exe -ArgumentList $processArgs -NoNewWindow -PassThru -RedirectStandardOutput .\test_data\logs\screenpipe_output.log -RedirectStandardError .\test_data\logs\screenpipe_error.log
if ($null -eq $process) {
Write-Error "Failed to start screenpipe process"
Expand Down
8 changes: 7 additions & 1 deletion scripts/simulate_audio_activity.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,13 @@ try {
$audioDevice = $env:TEST_AUDIO_DEVICE
if ($audioDevice) {
Write-Output "Using audio device: $audioDevice"
$synthesizer.SetOutputToAudioDevice($audioDevice)
try {
$synthesizer.SetOutputToAudioDevice($audioDevice)
} catch {
Write-Warning "Failed to set audio device. Error: $_"
Write-Output "Falling back to default audio device."
$synthesizer.SetOutputToDefaultAudioDevice()
}
} else {
Write-Output "TEST_AUDIO_DEVICE not set. Using default audio device."
$synthesizer.SetOutputToDefaultAudioDevice()
Expand Down

0 comments on commit af56934

Please sign in to comment.