{"id":4673,"date":"2022-04-27T11:43:05","date_gmt":"2022-04-27T09:43:05","guid":{"rendered":"https:\/\/www.pschatzmann.ch\/home\/?p=4673"},"modified":"2024-03-21T07:59:51","modified_gmt":"2024-03-21T06:59:51","slug":"low-latency-streaming-of-audio-data-using-esp-now","status":"publish","type":"post","link":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/27\/low-latency-streaming-of-audio-data-using-esp-now\/","title":{"rendered":"Arduino Low Latency Streaming of Audio Data  &#8211; Using ESP-Now ?"},"content":{"rendered":"<p>This blog continues the topic <a href=\"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/25\/low-latency-streaming-of-audio-data\/\">Low Latency Streaming of Audio Data<\/a> and we have a closer look at <strong>ESP-NOW<\/strong>. This is a protocol developed by Espressif, which enables multiple devices to communicate with one another without using Wi-Fi.<\/p>\n<p>I was missing a proper implementation that is based on <strong>Arduino Streams<\/strong>, so I have added one to my <a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\/blob\/main\/examples\/examples-audiokit\/basic-a2dp-audiokit\/basic-a2dp-audiokit.ino\">Arduino Audio Tools<\/a> Library.<\/p>\n<p>Here are the related <strong>example Arduino sketches<\/strong>:<\/p>\n<ul>\n<li><a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\/blob\/main\/examples\/examples-communication\/communication-espnow-send\/communication-espnow-send.ino\">communication-espnow-send<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\/blob\/main\/examples\/examples-communication\/communication-espnow-receive\/communication-espnow-receive.ino\">communication-espnow-receive<\/a><\/li>\n<li><a href=\"https:\/\/github.com\/pschatzmann\/arduino-audio-tools\/blob\/main\/examples\/examples-communication\/communication-espnow-receive_measure\/communication-espnow-receive_measure.ino\">communication-espnow-receive_measure<\/a><\/li>\n<\/ul>\n<p>When I was doing my tests, I first noticed that some audio data gets lost on the receiving side and it took quite some time until I figured out that I need to a blocking write to the buffer (and wait until enough memory is available again). The stream read is nice to have so that we have a consistent interface, but in real life it is much more efficient to provide a callback in the config where we e.g. just do a blocking write to i2s.<\/p>\n<p>I was measuring 33000 to 37000 bytes per second which gives <strong>16500 samples\/second in mono<\/strong> and  8250 samples per second in stereo. This is good enough for some basic audio but insufficient for HIFI music.<\/p>\n<p>So the conclusion here is as well, that we should use a <strong>low latency codec which is compressing audio<\/strong>. So in my <a href=\"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/28\/arduino-low-latency-streaming-of-audio-data-codecs\/\">next blog<\/a> we start to have a look at potential codecs.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>This blog continues the topic Low Latency Streaming of Audio Data and we have a closer look at ESP-NOW. This is a protocol developed by Espressif, which enables multiple devices to communicate with one another without using Wi-Fi. I was missing a proper implementation that is based on Arduino Streams, [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":4622,"comment_status":"open","ping_status":"open","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":[20,22],"tags":[46],"class_list":["post-4673","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.3 - https:\/\/yoast.com\/product\/yoast-seo-wordpress\/ -->\n<title>Arduino Low Latency Streaming of Audio Data - Using ESP-Now ? - 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\/2022\/04\/27\/low-latency-streaming-of-audio-data-using-esp-now\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"Arduino Low Latency Streaming of Audio Data - Using ESP-Now ? - Phil Schatzmann\" \/>\n<meta property=\"og:description\" content=\"This blog continues the topic Low Latency Streaming of Audio Data and we have a closer look at ESP-NOW. This is a protocol developed by Espressif, which enables multiple devices to communicate with one another without using Wi-Fi. I was missing a proper implementation that is based on Arduino Streams, [&hellip;]\" \/>\n<meta property=\"og:url\" content=\"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/27\/low-latency-streaming-of-audio-data-using-esp-now\/\" \/>\n<meta property=\"og:site_name\" content=\"Phil Schatzmann\" \/>\n<meta property=\"article:published_time\" content=\"2022-04-27T09:43:05+00:00\" \/>\n<meta property=\"article:modified_time\" content=\"2024-03-21T06:59:51+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/04\/transmitting.jpg\" \/>\n\t<meta property=\"og:image:width\" content=\"800\" \/>\n\t<meta property=\"og:image:height\" content=\"800\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/jpeg\" \/>\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=\"1 minute\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\\\/\\\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/27\\\/low-latency-streaming-of-audio-data-using-esp-now\\\/#article\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/27\\\/low-latency-streaming-of-audio-data-using-esp-now\\\/\"},\"author\":{\"name\":\"pschatzmann\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"headline\":\"Arduino Low Latency Streaming of Audio Data &#8211; Using ESP-Now ?\",\"datePublished\":\"2022-04-27T09:43:05+00:00\",\"dateModified\":\"2024-03-21T06:59:51+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/27\\\/low-latency-streaming-of-audio-data-using-esp-now\\\/\"},\"wordCount\":236,\"commentCount\":1,\"publisher\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#\\\/schema\\\/person\\\/73a53638a4e34e8373405fd737dac9b1\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/27\\\/low-latency-streaming-of-audio-data-using-esp-now\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/transmitting.jpg\",\"keywords\":[\"Communications\"],\"articleSection\":[\"Arduino\",\"Machine Sound\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/27\\\/low-latency-streaming-of-audio-data-using-esp-now\\\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/27\\\/low-latency-streaming-of-audio-data-using-esp-now\\\/\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/27\\\/low-latency-streaming-of-audio-data-using-esp-now\\\/\",\"name\":\"Arduino Low Latency Streaming of Audio Data - Using ESP-Now ? - Phil Schatzmann\",\"isPartOf\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/#website\"},\"primaryImageOfPage\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/27\\\/low-latency-streaming-of-audio-data-using-esp-now\\\/#primaryimage\"},\"image\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/27\\\/low-latency-streaming-of-audio-data-using-esp-now\\\/#primaryimage\"},\"thumbnailUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/transmitting.jpg\",\"datePublished\":\"2022-04-27T09:43:05+00:00\",\"dateModified\":\"2024-03-21T06:59:51+00:00\",\"breadcrumb\":{\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/27\\\/low-latency-streaming-of-audio-data-using-esp-now\\\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/27\\\/low-latency-streaming-of-audio-data-using-esp-now\\\/\"]}]},{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/27\\\/low-latency-streaming-of-audio-data-using-esp-now\\\/#primaryimage\",\"url\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/transmitting.jpg\",\"contentUrl\":\"https:\\\/\\\/www.pschatzmann.ch\\\/wp-content\\\/uploads\\\/2022\\\/04\\\/transmitting.jpg\",\"width\":800,\"height\":800},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/2022\\\/04\\\/27\\\/low-latency-streaming-of-audio-data-using-esp-now\\\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\\\/\\\/www.pschatzmann.ch\\\/home\\\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"Arduino Low Latency Streaming of Audio Data &#8211; Using ESP-Now ?\"}]},{\"@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 Low Latency Streaming of Audio Data - Using ESP-Now ? - 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\/2022\/04\/27\/low-latency-streaming-of-audio-data-using-esp-now\/","og_locale":"en_US","og_type":"article","og_title":"Arduino Low Latency Streaming of Audio Data - Using ESP-Now ? - Phil Schatzmann","og_description":"This blog continues the topic Low Latency Streaming of Audio Data and we have a closer look at ESP-NOW. This is a protocol developed by Espressif, which enables multiple devices to communicate with one another without using Wi-Fi. I was missing a proper implementation that is based on Arduino Streams, [&hellip;]","og_url":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/27\/low-latency-streaming-of-audio-data-using-esp-now\/","og_site_name":"Phil Schatzmann","article_published_time":"2022-04-27T09:43:05+00:00","article_modified_time":"2024-03-21T06:59:51+00:00","og_image":[{"width":800,"height":800,"url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/04\/transmitting.jpg","type":"image\/jpeg"}],"author":"pschatzmann","twitter_card":"summary_large_image","twitter_misc":{"Written by":"pschatzmann","Est. reading time":"1 minute"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/27\/low-latency-streaming-of-audio-data-using-esp-now\/#article","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/27\/low-latency-streaming-of-audio-data-using-esp-now\/"},"author":{"name":"pschatzmann","@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"headline":"Arduino Low Latency Streaming of Audio Data &#8211; Using ESP-Now ?","datePublished":"2022-04-27T09:43:05+00:00","dateModified":"2024-03-21T06:59:51+00:00","mainEntityOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/27\/low-latency-streaming-of-audio-data-using-esp-now\/"},"wordCount":236,"commentCount":1,"publisher":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#\/schema\/person\/73a53638a4e34e8373405fd737dac9b1"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/27\/low-latency-streaming-of-audio-data-using-esp-now\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/04\/transmitting.jpg","keywords":["Communications"],"articleSection":["Arduino","Machine Sound"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/www.pschatzmann.ch\/home\/2022\/04\/27\/low-latency-streaming-of-audio-data-using-esp-now\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/27\/low-latency-streaming-of-audio-data-using-esp-now\/","url":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/27\/low-latency-streaming-of-audio-data-using-esp-now\/","name":"Arduino Low Latency Streaming of Audio Data - Using ESP-Now ? - Phil Schatzmann","isPartOf":{"@id":"https:\/\/www.pschatzmann.ch\/home\/#website"},"primaryImageOfPage":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/27\/low-latency-streaming-of-audio-data-using-esp-now\/#primaryimage"},"image":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/27\/low-latency-streaming-of-audio-data-using-esp-now\/#primaryimage"},"thumbnailUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/04\/transmitting.jpg","datePublished":"2022-04-27T09:43:05+00:00","dateModified":"2024-03-21T06:59:51+00:00","breadcrumb":{"@id":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/27\/low-latency-streaming-of-audio-data-using-esp-now\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/www.pschatzmann.ch\/home\/2022\/04\/27\/low-latency-streaming-of-audio-data-using-esp-now\/"]}]},{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/27\/low-latency-streaming-of-audio-data-using-esp-now\/#primaryimage","url":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/04\/transmitting.jpg","contentUrl":"https:\/\/www.pschatzmann.ch\/wp-content\/uploads\/2022\/04\/transmitting.jpg","width":800,"height":800},{"@type":"BreadcrumbList","@id":"https:\/\/www.pschatzmann.ch\/home\/2022\/04\/27\/low-latency-streaming-of-audio-data-using-esp-now\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/www.pschatzmann.ch\/home\/"},{"@type":"ListItem","position":2,"name":"Arduino Low Latency Streaming of Audio Data &#8211; Using ESP-Now ?"}]},{"@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\/4673","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=4673"}],"version-history":[{"count":13,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/4673\/revisions"}],"predecessor-version":[{"id":4692,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/posts\/4673\/revisions\/4692"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media\/4622"}],"wp:attachment":[{"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/media?parent=4673"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/categories?post=4673"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.pschatzmann.ch\/home\/wp-json\/wp\/v2\/tags?post=4673"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}