11#include "nlohmann/json.hpp"
12#include "xtl/xbase64.hpp"
47 LOGE(
"Setting channels to 0");
76 str <<
"<style>div.x-svg {width: "<<
str_size <<
"px; }</style>";
77 str <<
"<div class='x-svg'><svg viewBox='0 0 "<<
str_size <<
" 100'> <polyline fill='none' stroke='blue' stroke-width='1' points ='";
81 str << idx++ <<
"," << sample <<
" ";
83 str <<
"'/></svg></div>";
91 std::stringstream
str;
98 int result = x / 1000;
120 copier.resize(bufferSize);
135 const std::string &
name()
const {
140 const std::string
path()
const {
141 std::filesystem::path p =
fname;
142 std::string result = std::filesystem::absolute(p);
160 }
catch(
const std::exception&
ex){
161 std::cerr <<
ex.what();
176 std::ifstream
fin(
fname, std::ios::binary);
179 return xtl::base64encode(
m_buffer.str());
206 auto bundle = nl::json::object();
207 bundle[
"text/html"] = in.chartData();
213 auto bundle = nl::json::object();
215 bundle[
"text/html"] =
"<audio controls "
216 "src='data:audio/wav;base64," +
#define LOGE(...)
Definition AudioLoggerIDF.h:30
nl::json mime_bundle_repr(Chart &in)
Disply Chart in Jupyterlab xeus.
Definition JupyterAudio.h:205
If you want to use the framework w/o Arduino you need to provide the implementation of a couple of cl...
#define assert(T)
Definition avr.h:10