Speaker

Description

Drives the Speaker to emit sound. Using different Speaker Blocks can control the sound's frequency, duration, volume, pitch, and beat.

Speaker.beep

  • Adjusts the frequency and duration.

Speaker.volume

  • Adjusts the volume.

play.tone

  • Adjusts the volume and beat.

Note

Because the average human hearing range is between 20Hz and 20kHz, you won't be able to hear the sound if you set the frequency too low or too high.

How to Use

Add the required Speaker Block to your program, modify its attributes or parameters to make the M5GO emit different sounds.

Speaker Core2

Description

Drives the Speaker to play local or cloud-based audio files and can adjust the audio playback's pitch, beat, and channels.

play local WAV file

  • Plays a WAV audio file stored in Flash (res/filename.wav) or on the SD card (/sd/filename.wav).

play local WAV file +

  • Click "+" to add a WAV audio file to Flash and play it.

play local WAV file samplerate data format channel

  • Plays a WAV audio file stored in Flash (res/filename.wav) or on the SD card (/sd/filename.wav), setting the sample rate, data format, and channels.

play cloud WAV file(URL)

  • Plays a cloud file by entering the audio link.

play tone for beat

  • Sets the pitch and beat and plays it.

Note: Only supports WAV file type and the size must not exceed 500KB.
To prevent the file from being too large, it is recommended to use a 16000 sampling rate, 16-bit WAV file.

How to Use

Upload AcousticRock-16B.wav to flash and play, play the local Trim.wav audio, play the audio file corresponding to the link.

On This Page