I'm currently facing a challenge where I need to play wav audio files on an HTML website. To give an impression of the codebase, let's say there's an SD card connected with SPI and we're using the fileserver example.
This example has been modified with the following piece of code to enable audio controls to be visible.
Code: Select all
httpd_resp_sendstr_chunk(req, "<tr><td><audio controls><source src=\"");
httpd_resp_sendstr_chunk(req, req->uri);
httpd_resp_sendstr_chunk(req, entry->d_name);
if (entry->d_type == DT_DIR) {
httpd_resp_sendstr_chunk(req, "/");
}
httpd_resp_sendstr_chunk(req, "\" type=\"audio/wav\">");
httpd_resp_sendstr_chunk(req, "</audio></td><td>");
Kind regards,
An interested Jochem