Audio

BlocklyProp reference for AUDIO blocks

BlocklyProp blocks for generating audio. See each block for board type compatibility.


frequency out

Compatible with all Propeller board types

The frequency out block generates pulses of the specified frequency and duration on an I/O pin. An example use would be generating beeps on a piezospeaker.

  • PIN: select the Propeller I/O pin on which to send the signal. Options may vary by board type.
  • duration (ms): insert a value block to set the duration in milliseconds for the pulses to last.
  • frequency (Hz) insert a value block to set the frequency of the pulses, in hertz. 

sound initialize

This block lauches a processor automatically. Use only instance of this block per project.

Compatible ony with the Activity Board WX and Badge WX board types.

The sound initialize block starts the polyphonic (multi-tone) sound process.


sound play

Available for Activity Board WX, FLiP, and both Badge board types.

The sound play block controls the frequency, volume, and waveform generated on the selected channel.

  • Select the sound channel: A, B, C, or D
  • Select the action
    • set frequency:  (in Hz?)
    • set volume: (units? range?)
    • set waveform: sine, square, triangle, sawtooth, or noise
    • stop: stops generating the waveform

text to speech say

Using either text to speech block will launch one processor (only one total, NOT one per block).

   For the Hackable Electronic Badge and Badge WX.

The TTS say block phonetically pronounces the letter characters in the attached text string block.


text to speech spell

Using either text to speech block will launch one processor (only one total, NOT one per block).

  For the Hackable Electronic Badge and Badge WX.

The TTS spell block pronounces each individual letter character from left to right in the attached text string block.


WAV play

This block is ONLY available for the Propeller Activity Board WX and Badge WX board type.

This block lauches TWO processors automatically.

The WAV play block does the following:

  • Sets up the microSD card reader connection for the specified board type
  • Sets up the WAV player object in the Propeller microcontroller
  • Plays the WAV formatted audio file from the SD card whose filename was typed into the block. 

The WAV file on the microSD card must be in the correct format.

Options from our Sound Library reference section:

  • Download pre-formatted files from the Sound Library
  • Re-format your audio files with the free Audacity software - tutoiral
  • Create your own new audio files with Audacity - tutorial

WAV blocks must be used with other types of blocks.

The WAV play block launches processors to manage the SD card and generate the audio oputput.  However, once the first processor has launched the others, it will shut itself down if it does not have any other blocks to execute. This breaks the project, and instead of hearing your audio track, you will just hear a buzzing sound.  To avoid this, the first processor must keep running. 

If your project does other things, like blink lights or make a robot move, your WAV file will play as long as other code keeps running.

If your project does NOT do other things and all you want to do is play the WAV file, do one of these two things:

  • Follow the WAV play block with an empty repeat forever block to play just one file, if you don't know how long it lasts.
  • Follow the WAV play block with a pause block with a duration lasting longer than your audio track. You can alternate WAV play blocks and pause blocks to play a series of WAV files.

WAV status

This block is ONLY available for the Propeller Activity Board WX and Badge WX board type.

The WAV status block provides a value of 1 (one/true) if a WAV file is currently playing and a value of 0 (zero/false) if a WAV file is not currently playing.


WAV volume

This block is ONLY available for the Propeller Activity Board WX and Badge WX board type.

The WAV volume block set the volume of the Propeller’s WAV player. A value of 0 is quietest and 10 is loudest.


WAV stop

This block is ONLY available for the Propeller Activity Board WX and Badge WX board type.

The WAV stop block stops playing a WAV file.


WAV set pins

Compatible ony with the Activity Board WX

The WAV set pins block is used only at the beginning of your program to send the WAV file player output to different pins.