{"id":6090,"date":"2024-02-27T10:06:49","date_gmt":"2024-02-27T09:06:49","guid":{"rendered":"https:\/\/www.pschatzmann.ch\/home\/?p=6090"},"modified":"2024-03-21T07:50:16","modified_gmt":"2024-03-21T06:50:16","slug":"arduino-audio-tools-receiving-audio-using-vban","status":"publish","type":"post","link":"https:\/\/www.pschatzmann.ch\/home\/2024\/02\/27\/arduino-audio-tools-receiving-audio-using-vban\/","title":{"rendered":"Arduino Audio Tools \u2013 Receiving Audio using VBAN"},"content":{"rendered":"<p>Quite some time ago, I demonstrated how you can <a href=\"https:\/\/www.pschatzmann.ch\/home\/2023\/10\/22\/audiotools-sending-audio-to-your-mobile-phone-using-vban\/\">send Audio to your mobile phone<\/a> using the VBAN protocol. Recently I have added support for <strong>receiving data<\/strong> to your microcontroller as well. With this you can use this protocol to build some cool two way communictations applications (e.g. walkie-talkie).<\/p>\n<h3>Arduino Sketch<\/h3>\n<p>Here is a sketch that receives the data and just outputs the audio with I2S. Just replace the output class with whatever you want!<\/p>\n<pre><code><br \/>#include \"AudioTools.h\"\n#include \"AudioLibs\/VBANStream.h\"\n#include \"AudioLibs\/AudioBoardStream.h\" \/\/ comment out when not using AudioKit\n\nI2SStream out;               \/\/ Audio Destination\nVBANStream in;               \/\/ Audio Source\nStreamCopy copier(out, in);  \/\/ copies sound into i2s\n\n\/\/ Arduino Setup\nvoid setup(void) {  \n  \/\/ Open Serial \n  Serial.begin(115200);\n  while(!Serial);\n  AudioLogger::instance().begin(Serial, AudioLogger::Info);\n\n  \/\/ setup output\n  auto cfg_out = out.defaultConfig(TX_MODE);\n  if (!out.begin(cfg_out)) stop();\n\n  \/\/ format changes in vban must change the output as well\n  in.setNotifyAudioChange(out);\n\n  \/\/ setup input from vban\n  auto cfg_in = in.defaultConfig(RX_MODE);\n  cfg_in.ssid = \"ssid\";\n  cfg_in.password = \"password\";\n  cfg_in.stream_name = \"Talkie\";\n  in.begin(cfg_in);\n}\n\n\/\/ Arduino loop - copy sound to out \nvoid loop() {\n  copier.copy();\n}\n\n<\/code><\/pre>\n<p>Just can just open the output and the input by providing some parameters.<br \/>\nThe critical thing is, that you indicate to forward format changes to the output, so that any sample rate changes or changes to the number of channels is rendered properly.<\/p>\n<p>For the time being only 16 data is supported.<\/p>\n<h3>Dependencies<\/h3>\n<p>You need to have the following libraries installed:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\">https:\/\/github.com\/pschatzmann\/arduino-audio-tools<\/a><\/li>\n<\/ul>\n<h3>Updated Source Code<\/h3>\n<p><a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\/tree\/main\/examples\/examples-communication\/vban\">This and other VBAN examples<\/a> can be found on Github. Please use the (potentially updated) code from Github.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Quite some time ago, I demonstrated how you can send Audio to your mobile phone using the VBAN protocol. Recently I have added support for receiving data to your microcontroller as well. With this you can use this protocol to build some cool two way communictations applications (e.g. walkie-talkie). Arduino [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":5902,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"_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":[20,22],"tags":[46],"class_list":["post-6090","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-arduino","category-machine-sound","tag-communications"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v27.8 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Arduino Audio Tools \u2013 Receiving Audio using VBAN - 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\/2024\/02\/27\/arduino-audio-tools-receiving-audio-using-vban\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Arduino Audio Tools \u2013 Receiving Audio using VBAN - Phil Schatzmann\" \/>\n<meta property=\"og:description\" content=\"Quite some time ago, I demonstrated how you can send Audio to your mobile phone using the VBAN protocol. Recently I have added support for receiving data to your microcontroller as well. With this you can use this protocol to build some cool two way communictations applications (e.g. walkie-talkie). Arduino [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pschatzmann.ch\/home\/2024\/02\/27\/arduino-audio-tools-receiving-audio-using-vban\/\" \/>\n<meta property=\"og:site_name\" content=\"Phil Schatzmann\" \/>\n<meta property=\"article:published_time\" content=\"2024-02-27T09:06:49+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-21T06:50:16+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2023\/10\/vbaudio.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\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"2 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2024\\\/02\\\/27\\\/arduino-audio-tools-receiving-audio-using-vban\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2024\\\/02\\\/27\\\/arduino-audio-tools-receiving-audio-using-vban\\\/\"},\"author\":{\"name\":\"pschatzmann\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"headline\":\"Arduino Audio Tools \u2013 Receiving Audio using VBAN\",\"datePublished\":\"2024-02-27T09:06:49+00:00\",\"dateModified\":\"2024-03-21T06:50:16+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2024\\\/02\\\/27\\\/arduino-audio-tools-receiving-audio-using-vban\\\/\"},\"wordCount\":170,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2024\\\/02\\\/27\\\/arduino-audio-tools-receiving-audio-using-vban\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/vbaudio.png\",\"keywords\":[\"Communications\"],\"articleSection\":[\"Arduino\",\"Machine Sound\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2024\\\/02\\\/27\\\/arduino-audio-tools-receiving-audio-using-vban\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2024\\\/02\\\/27\\\/arduino-audio-tools-receiving-audio-using-vban\\\/\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2024\\\/02\\\/27\\\/arduino-audio-tools-receiving-audio-using-vban\\\/\",\"name\":\"Arduino Audio Tools \u2013 Receiving Audio using VBAN - Phil Schatzmann\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2024\\\/02\\\/27\\\/arduino-audio-tools-receiving-audio-using-vban\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2024\\\/02\\\/27\\\/arduino-audio-tools-receiving-audio-using-vban\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/vbaudio.png\",\"datePublished\":\"2024-02-27T09:06:49+00:00\",\"dateModified\":\"2024-03-21T06:50:16+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2024\\\/02\\\/27\\\/arduino-audio-tools-receiving-audio-using-vban\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2024\\\/02\\\/27\\\/arduino-audio-tools-receiving-audio-using-vban\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2024\\\/02\\\/27\\\/arduino-audio-tools-receiving-audio-using-vban\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/vbaudio.png\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2023\\\/10\\\/vbaudio.png\",\"width\":225,\"height\":225},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2024\\\/02\\\/27\\\/arduino-audio-tools-receiving-audio-using-vban\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Arduino Audio Tools \u2013 Receiving Audio using VBAN\"}]},{\"@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":"Arduino Audio Tools \u2013 Receiving Audio using VBAN - 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\/2024\/02\/27\/arduino-audio-tools-receiving-audio-using-vban\/","og_locale":"en_US","og_type":"article","og_title":"Arduino Audio Tools \u2013 Receiving Audio using VBAN - Phil Schatzmann","og_description":"Quite some time ago, I demonstrated how you can send Audio to your mobile phone using the VBAN protocol. Recently I have added support for receiving data to your microcontroller as well. With this you can use this protocol to build some cool two way communictations applications (e.g. walkie-talkie). Arduino [&hellip;]","og_url":"https:\/\/www.pschatzmann.ch\/home\/2024\/02\/27\/arduino-audio-tools-receiving-audio-using-vban\/","og_site_name":"Phil Schatzmann","article_published_time":"2024-02-27T09:06:49+00:00","article_modified_time":"2024-03-21T06:50:16+00:00","og_image":[{"width":225,"height":225,"url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2023\/10\/vbaudio.png","type":"image\/png"}],"author":"pschatzmann","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pschatzmann","Est. reading time":"2 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pschatzmann.ch\/home\/2024\/02\/27\/arduino-audio-tools-receiving-audio-using-vban\/#article","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2024\/02\/27\/arduino-audio-tools-receiving-audio-using-vban\/"},"author":{"name":"pschatzmann","@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"headline":"Arduino Audio Tools \u2013 Receiving Audio using VBAN","datePublished":"2024-02-27T09:06:49+00:00","dateModified":"2024-03-21T06:50:16+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2024\/02\/27\/arduino-audio-tools-receiving-audio-using-vban\/"},"wordCount":170,"commentCount":1,"publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2024\/02\/27\/arduino-audio-tools-receiving-audio-using-vban\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2023\/10\/vbaudio.png","keywords":["Communications"],"articleSection":["Arduino","Machine Sound"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pschatzmann.ch\/home\/2024\/02\/27\/arduino-audio-tools-receiving-audio-using-vban\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pschatzmann.ch\/home\/2024\/02\/27\/arduino-audio-tools-receiving-audio-using-vban\/","url":"https:\/\/www.pschatzmann.ch\/home\/2024\/02\/27\/arduino-audio-tools-receiving-audio-using-vban\/","name":"Arduino Audio Tools \u2013 Receiving Audio using VBAN - Phil Schatzmann","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2024\/02\/27\/arduino-audio-tools-receiving-audio-using-vban\/#primaryimage"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2024\/02\/27\/arduino-audio-tools-receiving-audio-using-vban\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2023\/10\/vbaudio.png","datePublished":"2024-02-27T09:06:49+00:00","dateModified":"2024-03-21T06:50:16+00:00","breadcrumb":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2024\/02\/27\/arduino-audio-tools-receiving-audio-using-vban\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pschatzmann.ch\/home\/2024\/02\/27\/arduino-audio-tools-receiving-audio-using-vban\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/home\/2024\/02\/27\/arduino-audio-tools-receiving-audio-using-vban\/#primaryimage","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2023\/10\/vbaudio.png","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2023\/10\/vbaudio.png","width":225,"height":225},{"@type":"BreadcrumbList","@id":"https:\/\/www.pschatzmann.ch\/home\/2024\/02\/27\/arduino-audio-tools-receiving-audio-using-vban\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pschatzmann.ch\/home\/"},{"@type":"ListItem","position":2,"name":"Arduino Audio Tools \u2013 Receiving Audio using VBAN"}]},{"@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\/6090","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=6090"}],"version-history":[{"count":9,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/6090\/revisions"}],"predecessor-version":[{"id":6099,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/6090\/revisions\/6099"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media\/5902"}],"wp:attachment":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media?parent=6090"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/categories?post=6090"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/tags?post=6090"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}