ESP32 to play sounds, what possibilities there are to receive them OTA?
-
- Posts: 1
- Joined: Tue Jul 24, 2018 7:07 am
ESP32 to play sounds, what possibilities there are to receive them OTA?
I have a project where I need to be able to play sounds (voice) with the device. And it is necessary that these sound files can be updated, that let's say if I create a new sound file next week, the device can play this then.I see for example the ESP32 Pico d4 has 4MB of memory. With the quality I need I could fit a couple of minutes. So I thought, if it would be possible to get somehow the soundfiles updated over the air, with either wifi or bt?
- Vader_Mester
- Posts: 300
- Joined: Tue Dec 05, 2017 8:28 pm
- Location: Hungary
- Contact:
Re: ESP32 to play sounds, what possibilities there are to receive them OTA?
First of all, there are very good and detailed sound projects for the ESP32.
Second, you don't really need to use OTA. In our terms, OTA is used for updating the entire firmware of the ESP32, which is not needed if only the sound files need an update.
You can create a FAT-FS file system on your flash. You can open, read and write files to it using the standard C functions.
The only note here is that you might want ot look for WROOM or WROVER modules, where the flash size is bigger, the PICO-D4 can be too small.
I've seen modules out there with 16MB of flash, which should be enough for your application.
Additionaly if you choose WROVER modules, I've also seen some that has 16MB flash and an 8MB SPI RAM. You can then use the RAM to decompress your MP3 files and store them in as PCM, so that you will have slower response time when you try to use them.
The 8MB is enough for about 90seconds of sound, 44KHz, 16Bit mono PCM for instant access.
Second, you don't really need to use OTA. In our terms, OTA is used for updating the entire firmware of the ESP32, which is not needed if only the sound files need an update.
You can create a FAT-FS file system on your flash. You can open, read and write files to it using the standard C functions.
The only note here is that you might want ot look for WROOM or WROVER modules, where the flash size is bigger, the PICO-D4 can be too small.
I've seen modules out there with 16MB of flash, which should be enough for your application.
Additionaly if you choose WROVER modules, I've also seen some that has 16MB flash and an 8MB SPI RAM. You can then use the RAM to decompress your MP3 files and store them in as PCM, so that you will have slower response time when you try to use them.
The 8MB is enough for about 90seconds of sound, 44KHz, 16Bit mono PCM for instant access.
Code: Select all
task_t coffeeTask()
{
while(atWork){
if(!xStreamBufferIsEmpty(mug)){
coffeeDrink(mug);
} else {
xTaskCreate(sBrew, "brew", 9000, &mug, 1, NULL);
xSemaphoreTake(sCoffeeRdy, portMAX_DELAY);
}
}
vTaskDelete(NULL);
}
Who is online
Users browsing this forum: Majestic-12 [Bot] and 93 guests