Closed Emmanuele75 closed 4 months ago
Use tone function of arduino to play beep sound
Same question here and no, it is not about beeps. I just want to store the audio internally because I don't want to add any external memory such as SD or even a stream.
Doesn't have to be mp3 for my usecase though.
unsigned const char WavData[35564] = {
0x52, 0x49, 0x46, 0x46, 0xe4, 0x8a, 0x00, 0x00, 0x57, 0x41, 0x56, 0x45,
0x66, 0x6d, 0x74, 0x20, 0x10, 0x00, 0x00, 0x00, 0x01, 0x00, 0x01, 0x00,
[...] and so on
I'm looking for the same functionality. I converted a WAV to RAW to a header file and a feature that could then play that included .h file would be awesome!
Why should it be so complicated? You can save the audio file directly as SPIFFS or in an FFat partition without RAW conversion.
There are reasons for that, first is, not all ESP32 support SPIFF even if they should second is data from an array is faster which can be an issue if you want to play sounds on button press for a game.
A design change the would make this easier:
With this change, if I have an in-memory file, I could just write a simple AudioStream wrapper for it and hand it to class Audio for playing.
Maybe Audiostream can be made general enough to also include web streams which would allow for moving a lot of code out of the class Audio.
This issue is stale because it has been open for 30 days with no activity.
This issue was closed because it has been inactive for 14 days since being marked as stale.
Hi everyone! I would like to play a sound (beep) by loading it directly into a char array. Example:
const unsigned char beep_mp3[] = { 0x49, 0x44, 0x33, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x19, 0x54, 0x53, 0x53, 0x45, 0x00, 0x00, 0x00, 0x0f, 0x00, 0x00, 0x03, 0x4c, 0x61, 0x76, .........
There's no way I can get this. Can anyone help me? Thank you.