test(content): verify native Android PCM and complete speech coverage
This commit is contained in:
@@ -48,7 +48,7 @@ function Fixture([int]$Stage) {
|
||||
Step "fixture-$Stage-selection" @('shell','input','tap','1200','616')
|
||||
}
|
||||
function StartAudio([string]$Name,[int]$Seconds) {
|
||||
$args=@('-NoProfile','-File',(Join-Path $PSScriptRoot 'record-audio.ps1'),'-OutputPath',(Join-Path $EvidenceDir "$Name.wav"),'-Seconds',"$Seconds")
|
||||
$args=@('-NoProfile','-File',(Join-Path $PSScriptRoot 'record-native-audio.ps1'),'-OutputPath',(Join-Path $EvidenceDir "$Name.wav"),'-Seconds',"$Seconds",'-Serial',$Serial)
|
||||
$process=Start-Process pwsh -ArgumentList ($args | ForEach-Object {'"'+$_+'"'}) -WindowStyle Hidden -RedirectStandardOutput (Join-Path $EvidenceDir "$Name.stdout") -RedirectStandardError (Join-Path $EvidenceDir "$Name.stderr") -PassThru
|
||||
$recorders.Add(@{name=$Name;process=$process}); Start-Sleep -Seconds 2
|
||||
}
|
||||
@@ -58,7 +58,7 @@ function CompareAudio([string]$Name,[string[]]$Ids) {
|
||||
foreach ($id in $Ids) {
|
||||
$reference=Join-Path (Split-Path (Split-Path $PSScriptRoot -Parent) -Parent) "Assets/MagnetismHeroes/UnityRuntime/Presentation/Audio/Voice/$id.wav"
|
||||
$comparison=Join-Path $EvidenceDir "$Name-$id-match.json"
|
||||
& pwsh -NoProfile -File (Join-Path $PSScriptRoot 'compare-audio.ps1') -ReferencePath $reference -CapturedPath (Join-Path $EvidenceDir "$Name.wav") -OutputPath $comparison
|
||||
& pwsh -NoProfile -File (Join-Path $PSScriptRoot 'compare-audio.ps1') -ReferencePath $reference -CapturedPath (Join-Path $EvidenceDir "$Name.wav") -OutputPath $comparison -RequireFullSpeech
|
||||
$exit=$LASTEXITCODE; $match=Get-Content -LiteralPath $comparison -Raw | ConvertFrom-Json
|
||||
Check "pcm-$Name-$id" ($exit -eq 0 -and $match.passed -and $match.normalizedCorrelation -ge .95 -and $match.rmsPcm -gt 32) ($match | ConvertTo-Json -Compress)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user