View previous topic :: View next topic |
Author |
Message |
Duval JP
Joined: 22 Jun 2004 Posts: 1161 Location: France
|
Posted: Fri Jan 08, 2021 1:29 pm Post subject: MP3, WAV player |
|
|
hi
a small project based on the DF0534 MP3 WAV module from DFrobot
This module allows the reading of audio files in MP3/wav format sampled from 8 kHz to 48 kHz on a storage space of 8 Mb. This is not much but very sufficient to make sound effects, to send alert messages or .... to sound a clock.
They are many possibilities and you will discover them on the wiki of the manufacturer.
What I retained:
- We transfer MP3 or WAV files to the internal flash memory as if it were a USB key.
- attention : the order of the files does not work as indicated on the notice, I did not understand why ?
so it is necessary to test everything for example I renamed my files as indicated 01.mp3, 02.mp3.... but to launch the 01 I must send the code &h0A the code &h01 makes it possible to read a pre-recorded file which I left for the tests and renamed as 20.mp3.
- You have to start by adjusting the volume
- If you are using the include and enriching it, please let us know.
The demo programme allows you to play the attached pieces.
I have added waiting times between each call of the sub play( track) but in one of your programme you can for example launch sound 01 when the pressure, the tension was low... is sends your alarm without interrupting your programme.
the video :
[url] https://youtu.be/EOLCZLjy13g[/url]
JP _________________ pleasure to learn, to teach, to create |
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Fri Jan 08, 2021 1:58 pm Post subject: |
|
|
thanks for sharing JP.
I moved the topic to AVR since it was in 8051 and the processor used was an AVR.
Should run on 8051 too with minor changes. _________________ Mark |
|
Back to top |
|
|
Duval JP
Joined: 22 Jun 2004 Posts: 1161 Location: France
|
Posted: Fri Jan 08, 2021 2:19 pm Post subject: |
|
|
Quote: | I moved the topic to AVR since it was in 8051 and the processor used was an AVR. |
sometime I'm too speedy and I am very often dizzy
_________________ pleasure to learn, to teach, to create |
|
Back to top |
|
|
Duval JP
Joined: 22 Jun 2004 Posts: 1161 Location: France
|
|
Back to top |
|
|
albertsm
Joined: 09 Apr 2004 Posts: 5913 Location: Holland
|
Posted: Sat Jan 30, 2021 1:29 pm Post subject: |
|
|
thanks for the addition. i only do not get why you add a 0 to a byte? _________________ Mark |
|
Back to top |
|
|
Duval JP
Joined: 22 Jun 2004 Posts: 1161 Location: France
|
Posted: Sat Jan 30, 2021 5:25 pm Post subject: |
|
|
Hello Mark,
You know, I follow the wiki. but they give very poor help , maybe the process need a null char
Quote: | Increase the volume(14)
Command: AA 14 00 BE
Return: None
Reduce the volume(15)
Command: AA 15 00 BF
Return: None |
It is working well
JP _________________ pleasure to learn, to teach, to create |
|
Back to top |
|
|
i.dobson
Joined: 05 Jan 2006 Posts: 1570 Location: Basel, Switzerland
|
Posted: Sat Jan 30, 2021 5:48 pm Post subject: |
|
|
Hi,
What mark means is, why are you wasting cpu time:-
Cs = &HAA + &H14 : Cs = Cs + &H00 :
X+0=X
Regards
Ian Dobson _________________ Walking on water and writing software to specification is easy if they're frozen. |
|
Back to top |
|
|
Duval JP
Joined: 22 Jun 2004 Posts: 1161 Location: France
|
Posted: Sun Jan 31, 2021 10:50 am Post subject: |
|
|
You are right Ian
for the checksum That is a coy/paste drama . I use the same line for all routine
but you have to send the &H0 when the routine need it
see
https://wiki.dfrobot.com/Voice_Module_SKU__DFR0534
JP _________________ pleasure to learn, to teach, to create |
|
Back to top |
|
|
|