Sonido#

Introducción#

El robot de programación VEX AIM permite a los usuarios reproducir sonidos integrados, archivos de audio personalizados y notas musicales. Además, incluye controles para detener la reproducción de sonidos y detectar si se está reproduciendo algún audio.

A continuación se muestra una lista de todos los bloques:

reproducir sonido#

The play sound stack block plays one of the robot’s built-in sounds.

Bloque de pila de reproducción de sonido de timbre#
play sound [act happy v] ▶

Parámetros

Descripción

sonido

Uno de los sonidos incorporados que se muestran a continuación.

and don’t wait

Select the arrow ( ▶ ) to expand the block to say and don’t wait, so the next block in the stack will run right away.

Nombre del sonido

Reproducir sonido

actúa feliz

actuar triste

actuar tontamente

actuar enojado

actuar emocionado

seguir adelante

mover hacia atrás

Gire a la derecha

Gire a la izquierda

chocar

frenos

levantar

detección

detectado

obstáculo

brillar

intermitente

chirrido

bucle

completo

enviar

recibir

pausa

reanudar

Tada

fallar

timbre de la puerta

huah

florecer

alegría

Ejemplo

Cuando se inicia, reproduce el sonido “actúa feliz”.#
when started
[Play the act happy sound.]
play sound [act happy v] ▶

reproducir archivo de sonido#

The play sound file stack block plays a custom sound loaded by the user.

Reproducir sonido de usuario 1 bloque de pila#
play sound file [1 v] ▶

Parámetros

Descripción

número de ranura de sonido

El sonido personalizado a utilizar, número del 1 al 10. El número del sonido se alinea con el número que se muestra en el Panel de control de AIM.

and don’t wait

Select the arrow ( ▶ ) to expand the block to say and don’t wait, so the next block in the stack will run right away.

Ejemplo

Al iniciarse, reproducir el sonido del usuario 1.#
when started
[Upload a sound file in VEXcode.]
[Play the custom sound.]
play sound file [1 v] ▶

nota de reproducción#

El bloque reproducir nota reproduce una nota específica durante una duración específica.

El bloque de acción de nota de reproducción.#
play note [low v] [C v] [note_eight v] ▶

Parámetros

Descripción

octava

The octave of the note: low or high.

nota

Define la altura musical:

  • C
  • C#
  • D
  • D#
  • E
  • F
  • F#
  • G
  • G#
  • A
  • A#
  • B
  • silencio

longitud de la nota

Establece la duración de la nota:

  • Nota redonda — Nota redonda
  • Nota blanca — Nota blanca
  • Nota negra — Nota negra
  • Nota corchea — Nota corchea
  • Nota semicorchea — Nota semicorchea

and don’t wait

Select the arrow ( ▶ ) to expand the block to say and don’t wait, so the next block in the stack will run right away.

Ejemplo

Reproduzca el archivo de sonido 1 y espere 2 segundos. Si el sonido sigue activo, deténgalo.#
when started
[Play a short tune.]
play note [low v] [C v] [note_half v] ▶
play note [low v] [D v] [note_quarter v] ▶
play note [low v] [E v] [note_sixteenth v] ▶

detener el sonido#

The stop sound stack block stops a sound that is currently playing.

El bloque de acción de sonido de parada.#
stop sound

Parámetros

Descripción

Este bloque no tiene parámetros.

Ejemplo

Reproduzca el archivo de sonido 1 y espere 2 segundos. Si el sonido sigue activo, deténgalo.#
when started
[Stop sound if it is still playing after 2 seconds]
play sound file [1 v] ◀ and don't wait
wait (2) seconds
if <sound active?> then
stop sound
fin

sound active#

The sound active Boolean block reports whether any sound is currently playing.

  • True — There is a sound playing.

  • False — There is no sound playing.

El bloque booleano de sonido activo.#
<sound active?>

Parámetros

Descripción

Este bloque no tiene parámetros.

Ejemplo

Reproduzca el archivo de sonido 1 y espere 2 segundos. Si el sonido sigue activo, deténgalo.#
when started
[Stop sound if it is still playing after 2 seconds]
play sound file [1 v] ◀ and don't wait
wait (2) seconds
if <sound active?> then
stop sound
fin