• EnglishSpanishGermanFrenchPolishChinese (Traditional)


EnglishSpanishGermanFrenchPolishChinese (Traditional)

Operating systems, scripting, PowerShell and security

Operating systems, software development, scripting, PowerShell tips, network and security

Menú principal
  • Categorías
  • Cursos
  • Libro de PowerShell
  • Lo mejor
  • Lo último
  • Proyectos
  • Contactar
Ir al contenido

Comunicar dos ordenadores mediante la voz del sistema operativo

En uno de los ordenadores (el que emite los mensajes) ejecutamos el siguiente script en PowerShell (leer el texto contenido dentro de un fichero mediante la voz del Sistema Operativo):

PowerShell
1
2
3
4
5
6
7
8
9
10
#Leer el texto contenido dentro de un fichero mediante la voz del Sistema Operativo
Add-Type -AssemblyName System.Speech
gc E:\aleer\fichero.txt | %{
$synthesizer = New-Object -TypeName System.Speech.Synthesis.SpeechSynthesizer
$_
#Establece la velocidad de habla de la SpeechSynthesizer
$synthesizer.Rate=0
$synthesizer.Speak($_)
}

En el otro ordenador (el que recibe los mensajes) ejecutamos el siguiente script en PowerShell (convertir la entrada de micrófono a texto):

PowerShell
1
2
3
4
5
6
7
8
9
[void][reflection.assembly]::loadwithpartialname('system.speech')
$rec = New-Object 'System.Speech.Recognition.SpeechRecognitionEngine'
$rec.LoadGrammar((New-Object 'System.Speech.Recognition.DictationGrammar'))
$rec.SetInputToDefaultAudioDevice()
do
{
$rec.Recognize().Text | Out-File e:\wavtext.txt -Append
}while(1)

Publicado el día 10 de enero de 2016

CATEGORÍAS

Multimedia, PowerShell, Reconocimiento

ETIQUETAS

Add-Type, Append, AssemblyName, gc, Jesús Niño Camazón, LoadWithPartialName, New-Object, Out-File, Reflection.Assembly, Sistema Operativo, Speak, SpeechSynthesizer, system.speech, System.Speech.Recognition.DictationGrammar, System.Speech.Recognition.SpeechRecognitionEngine, System.Speech.Synthesis.SpeechSynthesizer

MÁS

  • Automatizar el funcionamiento de una aplicación que simula un piano (pulsar automáticamente las notas del piano)
  • Crear formulario dentro de otro formulario mediante una función con PowerShell
  • 11. Gestión del Directorio Activo (nivel intermedio)
  • Crear una aplicación gráfica en PowerShell que represente un piano (con las notas del DO a SI) y que suene cada nota
  • Ejercicios de seguridad: práctica sobre virus
  • Buscar el nombre de una clase de un formulario en PowerShell con Microsoft Spy++ y escribir un mensaje en una caja de texto sin conocer el identificador de ventana en concreto del proceso…