forked from mediar-ai/screenpipe
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: David Anyatonwu <[email protected]>
- Loading branch information
1 parent
eda1771
commit 005c16c
Showing
3 changed files
with
57 additions
and
37 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,33 @@ | ||
Add-Type -AssemblyName System.Speech | ||
|
||
$synthesizer = New-Object System.Speech.Synthesis.SpeechSynthesizer | ||
|
||
# Try to set the audio output to the default device | ||
try { | ||
$synthesizer.SetOutputToDefaultAudioDevice() | ||
} catch { | ||
Write-Output "Failed to set audio output to default device: $_" | ||
# If setting to default device fails, try to use the first available device | ||
$audioDevices = [System.Speech.Synthesis.SpeechSynthesizer]::InstalledVoices | ||
if ($audioDevices.Count -gt 0) { | ||
$synthesizer.SelectVoice($audioDevices[0].VoiceInfo.Name) | ||
} else { | ||
Write-Output "No audio devices available. Audio simulation will be skipped." | ||
exit | ||
} | ||
} | ||
$synthesizer = New-Object System.Speech.Synthesis.SpeechSynthesizer | ||
|
||
while ($true) { | ||
# Try to set the audio output to the default device | ||
try { | ||
$synthesizer.SpeakAsync("This is a test of screenpipe CLI audio capture") | ||
Start-Sleep -Seconds 2 | ||
$synthesizer.SetOutputToDefaultAudioDevice() | ||
} catch { | ||
Write-Output "Error during speech synthesis: $_" | ||
Start-Sleep -Seconds 5 | ||
Write-Output "Failed to set audio output to default device: $_" | ||
# If setting to default device fails, try to use the first available device | ||
$audioDevices = [System.Speech.Synthesis.SpeechSynthesizer]::InstalledVoices | ||
if ($audioDevices.Count -gt 0) { | ||
$synthesizer.SelectVoice($audioDevices[0].VoiceInfo.Name) | ||
} else { | ||
Write-Output "No audio devices available. Audio simulation will be skipped." | ||
exit | ||
} | ||
} | ||
|
||
while ($true) { | ||
try { | ||
$synthesizer.SpeakAsync("This is a test of screenpipe CLI audio capture") | ||
Start-Sleep -Seconds 2 | ||
} catch { | ||
Write-Output "Error during speech synthesis: $_" | ||
Start-Sleep -Seconds 5 | ||
} | ||
} | ||
} catch { | ||
Write-Error "Error in simulate_audio_activity: $_" | ||
exit 1 | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,17 +1,22 @@ | ||
Add-Type -AssemblyName System.Windows.Forms | ||
|
||
while ($true) { | ||
# Simulate mouse movement | ||
for ($i = 0; $i -lt 20; $i++) { | ||
$x = Get-Random -Minimum 0 -Maximum ([System.Windows.Forms.Screen]::PrimaryScreen.Bounds.Width) | ||
$y = Get-Random -Minimum 0 -Maximum ([System.Windows.Forms.Screen]::PrimaryScreen.Bounds.Height) | ||
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $y) | ||
Start-Sleep -Milliseconds 200 | ||
} | ||
try { | ||
while ($true) { | ||
# Simulate mouse movement | ||
for ($i = 0; $i -lt 20; $i++) { | ||
$x = Get-Random -Minimum 0 -Maximum ([System.Windows.Forms.Screen]::PrimaryScreen.Bounds.Width) | ||
$y = Get-Random -Minimum 0 -Maximum ([System.Windows.Forms.Screen]::PrimaryScreen.Bounds.Height) | ||
[System.Windows.Forms.Cursor]::Position = New-Object System.Drawing.Point($x, $y) | ||
Start-Sleep -Milliseconds 200 | ||
} | ||
|
||
# Simulate typing | ||
[System.Windows.Forms.SendKeys]::SendWait("Screenpipe Test Content{ENTER}") | ||
[System.Windows.Forms.SendKeys]::SendWait("This is a test of screenpipe CLI{ENTER}") | ||
# Simulate typing | ||
[System.Windows.Forms.SendKeys]::SendWait("Screenpipe Test Content{ENTER}") | ||
[System.Windows.Forms.SendKeys]::SendWait("This is a test of screenpipe CLI{ENTER}") | ||
|
||
Start-Sleep -Seconds 1 | ||
Start-Sleep -Seconds 1 | ||
} | ||
} catch { | ||
Write-Error "Error in simulate_screen_activity: $_" | ||
exit 1 | ||
} |