Drives the Speaker to emit sound. Using different Speaker Blocks can control the sound's frequency, duration, volume, pitch, and beat.
Speaker.beep
Speaker.volume
play.tone
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.
Add the required Speaker Block to your program, modify its attributes or parameters to make the M5GO emit different sounds.
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
res/filename.wav
) or on the SD card (/sd/filename.wav
).play local WAV file +
play local WAV file samplerate data format channel
res/filename.wav
) or on the SD card (/sd/filename.wav
), setting the sample rate, data format, and channels.play cloud WAV file(URL)
play tone for beat
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.
Upload AcousticRock-16B.wav to flash and play, play the local Trim.wav audio, play the audio file corresponding to the link.