Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- $OUT_DIR=".\flac2txt"
- $RATE=44100
- if(!(Test-Path -Path $OUT_DIR))
- {
- New-Item -Path $OUT_DIR -ItemType "directory"|Out-Null
- }
- elseif(!(Test-Path -Path $OUT_DIR -PathType Container))
- {
- throw "$OUT_DIR is not a directory"
- }
- foreach($file in Get-ChildItem -Path "wav2flac" -Filter "*flac")
- {
- $TEXTFILE="$($file.BaseName).txt"
- Write-Output " Calling for $($file.Name) Google..."
- Invoke-WebRequest -Body ($file|Get-Content) -OutFile (Join-Path -Path $OUT_DIR -ChildPath $TEXTFILE) -ContentType "audio/x-flac; rate=$RATE" -Method Post -Uri "https://www.google.com/speech-api/v1/recognize?xjerr=1&client=chromium&lang=hu-HU"
- }
Advertisement
Add Comment
Please, Sign In to add comment