{"id":6636,"date":"2025-03-20T13:00:55","date_gmt":"2025-03-20T12:00:55","guid":{"rendered":"https:\/\/www.pschatzmann.ch\/home\/?p=6636"},"modified":"2025-03-25T07:30:52","modified_gmt":"2025-03-25T06:30:52","slug":"audiotools-esp32-idf-and-files-the-final-frontier","status":"publish","type":"post","link":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/20\/audiotools-esp32-idf-and-files-the-final-frontier\/","title":{"rendered":"AudioTools: ESP32 IDF and Files &#8211; The Final Frontier"},"content":{"rendered":"<p>After we can access the Internet purely using IDF functionality w\/o Arduino, the final challange is to provide <strong>access to files<\/strong> as Streams!<\/p>\n<p>IDF provides the concept of the <strong>Virtual File System (VFS)<\/strong>: you can mount a file system under a name and access the files of that file system using the name as prefix. For this the POSIX file API is supported and therefore we have all standard C and C++ file methods available.<\/p>\n<p>To use the files in the AudioTools, I created the following (easy to use) <a href=\"https:\/\/pschatzmann.github.io\/arduino-audio-tools\/classaudio__tools_1_1_v_f_s.html\">VFS classes<\/a>:<\/p>\n<ul>\n<li><a href=\"https:\/\/pschatzmann.github.io\/arduino-audio-tools\/classaudio__tools_1_1_v_f_s___s_d_s_p_i.html\">VFS_SDSPI<\/a><\/li>\n<li><a href=\"https:\/\/pschatzmann.github.io\/arduino-audio-tools\/classaudio__tools_1_1_v_f_s___s_d_m_m_c.html\">VFS_SDMMC<\/a><\/li>\n<li><a href=\"https:\/\/pschatzmann.github.io\/arduino-audio-tools\/classaudio__tools_1_1_v_f_s___little_f_s.html\">VFS_LittleFS<\/a><\/li>\n<li><a href=\"https:\/\/pschatzmann.github.io\/arduino-audio-tools\/classaudio__tools_1_1_v_f_s___s_p_f_f_s.html\">VFS_SPFFS<\/a><\/li>\n<li><a href=\"https:\/\/pschatzmann.github.io\/arduino-audio-tools\/classaudio__tools_1_1_v_f_s___multi.html\">VFS_Multi<\/a><\/li>\n<\/ul>\n<p>and for the <strong>AudioPlayer<\/strong> I created the new <a href=\"https:\/\/pschatzmann.github.io\/arduino-audio-tools\/classaudio__tools_1_1_audio_source_v_f_s.html\">AudioSourceVFS<\/a> class, that requires the VFS as parameter and that we can use to define the audio source for the AudioPlayer.<\/p>\n<h3>Example Arduino Sketch<\/h3>\n<p>Here is a short demo that provides the first 10 files via the VFS SPI SD:<\/p>\n<pre><code>#include \"AudioTools.h\"\n#include \"AudioTools\/Disk\/AudioSourceVFS.h\"\n#include \"AudioTools\/Disk\/VFS_SDSPI.h\"\n\n\/\/  We use an AudioKit or LyraT for the tests which uses the following pins\n\/\/  CS,  MOSI,  MISO,  SCK\nVFS_SDSPI sd(13, 15, 2, 14);\nAudioSourceVFS source(sd, \"\/sdcard\", \".mp3\");\n\nvoid setup() {\n  Serial.begin(115200);\n  AudioToolsLogger.begin(Serial, AudioToolsLogLevel::Info);\n\n  source.begin();\n  for (int j = 0; j &lt; 10; j++) {\n    VFSFile* p_file = (VFSFile*)source.selectStream(j);\n    if (p_file)\n      Serial.println(p_file-&gt;name());\n  }\n}\n\nvoid loop() {}\n<\/code><\/pre>\n<p>Since the IDF is part of the Arduino API, you can use this functionality also in Arduino.<\/p>\n<p>With this functionality you are now able to build a working audio file player in IDF as well.<\/p>\n<h3>Dependencies<\/h3>\n<ul>\n<li><a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\">arduino-audio-tools<\/a><\/li>\n<\/ul>\n<h3>Source Code<\/h3>\n<p>You can find the actual version of the <a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\/blob\/main\/examples\/tests\/player\/test-vfs\/test-vfs.ino\">source code for this example on Github<\/a>!<\/p>\n","protected":false},"excerpt":{"rendered":"<p>After we can access the Internet purely using IDF functionality w\/o Arduino, the final challange is to provide access to files as Streams! IDF provides the concept of the Virtual File System (VFS): you can mount a file system under a name and access the files of that file system [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":6623,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_crdt_document":"","_import_markdown_pro_load_document_selector":0,"_import_markdown_pro_submit_text_textarea":"","_exactmetrics_skip_tracking":false,"_exactmetrics_sitenote_active":false,"_exactmetrics_sitenote_note":"","_exactmetrics_sitenote_category":0,"footnotes":""},"categories":[22],"tags":[50],"class_list":["post-6636","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-machine-sound","tag-idf"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>AudioTools: ESP32 IDF and Files - The Final Frontier - Phil Schatzmann<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/20\/audiotools-esp32-idf-and-files-the-final-frontier\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"AudioTools: ESP32 IDF and Files - The Final Frontier - Phil Schatzmann\" \/>\n<meta property=\"og:description\" content=\"After we can access the Internet purely using IDF functionality w\/o Arduino, the final challange is to provide access to files as Streams! IDF provides the concept of the Virtual File System (VFS): you can mount a file system under a name and access the files of that file system [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/20\/audiotools-esp32-idf-and-files-the-final-frontier\/\" \/>\n<meta property=\"og:site_name\" content=\"Phil Schatzmann\" \/>\n<meta property=\"article:published_time\" content=\"2025-03-20T12:00:55+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2025-03-25T06:30:52+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2025\/03\/idf.png\" \/>\n\t<meta property=\"og:image:width\" content=\"225\" \/>\n\t<meta property=\"og:image:height\" content=\"225\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"pschatzmann\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"pschatzmann\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/20\\\/audiotools-esp32-idf-and-files-the-final-frontier\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/20\\\/audiotools-esp32-idf-and-files-the-final-frontier\\\/\"},\"author\":{\"name\":\"pschatzmann\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"headline\":\"AudioTools: ESP32 IDF and Files &#8211; The Final Frontier\",\"datePublished\":\"2025-03-20T12:00:55+00:00\",\"dateModified\":\"2025-03-25T06:30:52+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/20\\\/audiotools-esp32-idf-and-files-the-final-frontier\\\/\"},\"wordCount\":212,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/20\\\/audiotools-esp32-idf-and-files-the-final-frontier\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/idf.png\",\"keywords\":[\"IDF\"],\"articleSection\":[\"Machine Sound\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/20\\\/audiotools-esp32-idf-and-files-the-final-frontier\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/20\\\/audiotools-esp32-idf-and-files-the-final-frontier\\\/\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/20\\\/audiotools-esp32-idf-and-files-the-final-frontier\\\/\",\"name\":\"AudioTools: ESP32 IDF and Files - The Final Frontier - Phil Schatzmann\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/20\\\/audiotools-esp32-idf-and-files-the-final-frontier\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/20\\\/audiotools-esp32-idf-and-files-the-final-frontier\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/idf.png\",\"datePublished\":\"2025-03-20T12:00:55+00:00\",\"dateModified\":\"2025-03-25T06:30:52+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/20\\\/audiotools-esp32-idf-and-files-the-final-frontier\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/20\\\/audiotools-esp32-idf-and-files-the-final-frontier\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/20\\\/audiotools-esp32-idf-and-files-the-final-frontier\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/idf.png\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2025\\\/03\\\/idf.png\",\"width\":225,\"height\":225},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2025\\\/03\\\/20\\\/audiotools-esp32-idf-and-files-the-final-frontier\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"AudioTools: ESP32 IDF and Files &#8211; The Final Frontier\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\",\"name\":\"Phil Schatzmann Consulting\",\"description\":\"\",\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":[\"Person\",\"Organization\"],\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\",\"name\":\"pschatzmann\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\",\"width\":305,\"height\":305,\"caption\":\"pschatzmann\"},\"logo\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/08\\\/pschatzmann.png\"}}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"AudioTools: ESP32 IDF and Files - The Final Frontier - Phil Schatzmann","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/20\/audiotools-esp32-idf-and-files-the-final-frontier\/","og_locale":"en_US","og_type":"article","og_title":"AudioTools: ESP32 IDF and Files - The Final Frontier - Phil Schatzmann","og_description":"After we can access the Internet purely using IDF functionality w\/o Arduino, the final challange is to provide access to files as Streams! IDF provides the concept of the Virtual File System (VFS): you can mount a file system under a name and access the files of that file system [&hellip;]","og_url":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/20\/audiotools-esp32-idf-and-files-the-final-frontier\/","og_site_name":"Phil Schatzmann","article_published_time":"2025-03-20T12:00:55+00:00","article_modified_time":"2025-03-25T06:30:52+00:00","og_image":[{"width":225,"height":225,"url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2025\/03\/idf.png","type":"image\/png"}],"author":"pschatzmann","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pschatzmann"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/20\/audiotools-esp32-idf-and-files-the-final-frontier\/#article","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/20\/audiotools-esp32-idf-and-files-the-final-frontier\/"},"author":{"name":"pschatzmann","@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"headline":"AudioTools: ESP32 IDF and Files &#8211; The Final Frontier","datePublished":"2025-03-20T12:00:55+00:00","dateModified":"2025-03-25T06:30:52+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/20\/audiotools-esp32-idf-and-files-the-final-frontier\/"},"wordCount":212,"commentCount":0,"publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/20\/audiotools-esp32-idf-and-files-the-final-frontier\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2025\/03\/idf.png","keywords":["IDF"],"articleSection":["Machine Sound"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pschatzmann.ch\/home\/2025\/03\/20\/audiotools-esp32-idf-and-files-the-final-frontier\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/20\/audiotools-esp32-idf-and-files-the-final-frontier\/","url":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/20\/audiotools-esp32-idf-and-files-the-final-frontier\/","name":"AudioTools: ESP32 IDF and Files - The Final Frontier - Phil Schatzmann","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/20\/audiotools-esp32-idf-and-files-the-final-frontier\/#primaryimage"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/20\/audiotools-esp32-idf-and-files-the-final-frontier\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2025\/03\/idf.png","datePublished":"2025-03-20T12:00:55+00:00","dateModified":"2025-03-25T06:30:52+00:00","breadcrumb":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/20\/audiotools-esp32-idf-and-files-the-final-frontier\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pschatzmann.ch\/home\/2025\/03\/20\/audiotools-esp32-idf-and-files-the-final-frontier\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/20\/audiotools-esp32-idf-and-files-the-final-frontier\/#primaryimage","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2025\/03\/idf.png","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2025\/03\/idf.png","width":225,"height":225},{"@type":"BreadcrumbList","@id":"https:\/\/www.pschatzmann.ch\/home\/2025\/03\/20\/audiotools-esp32-idf-and-files-the-final-frontier\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pschatzmann.ch\/home\/"},{"@type":"ListItem","position":2,"name":"AudioTools: ESP32 IDF and Files &#8211; The Final Frontier"}]},{"@type":"WebSite","@id":"https:\/\/www.pschatzmann.ch\/home\/#website","url":"https:\/\/www.pschatzmann.ch\/home\/","name":"Phil Schatzmann Consulting","description":"","publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/www.pschatzmann.ch\/home\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":["Person","Organization"],"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1","name":"pschatzmann","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png","width":305,"height":305,"caption":"pschatzmann"},"logo":{"@id":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/08\/pschatzmann.png"}}]}},"post_mailing_queue_ids":[],"_links":{"self":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/6636","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/comments?post=6636"}],"version-history":[{"count":9,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/6636\/revisions"}],"predecessor-version":[{"id":6649,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/6636\/revisions\/6649"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media\/6623"}],"wp:attachment":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media?parent=6636"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/categories?post=6636"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/tags?post=6636"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}