diff options
Diffstat (limited to 'rotord/rotor.cpp')
| -rwxr-xr-x | rotord/rotor.cpp | 20 |
1 files changed, 15 insertions, 5 deletions
diff --git a/rotord/rotor.cpp b/rotord/rotor.cpp index eb86c27..da8f811 100755 --- a/rotord/rotor.cpp +++ b/rotord/rotor.cpp @@ -572,9 +572,9 @@ int Audio_thumbnailer::process_frame(uint8_t *_data,int samples_in_frame){ if (sample==samples_per_column) { //finished a column //get root-mean double mean=pow(accum/samples,0.5); - if (column==0) { - cerr << "first column total: "<< accum << " in " << samples << " samples, average " << (accum/samples)<<endl; - } + //if (column==0) { + // cerr << "first column total: "<< accum << " in " << samples << " samples, average " << (accum/samples)<<endl; + //} int colheight=height*mean*0.5; int hh=height>>1; for (int i=0;i<height;i++) { @@ -589,14 +589,24 @@ int Audio_thumbnailer::process_frame(uint8_t *_data,int samples_in_frame){ return out_sample; } string Audio_thumbnailer::print(){ - string output; + //base64 encode the image data output it + + stringstream output; + Poco::Base64Encoder *enc=new Poco::Base64Encoder(output); + + enc->write(data,width*height); + //tring output; + /* for (int j=0;j<height;j++) { for (int i=0;i<width;i++) { output+=data[j*width+i]<0x7f?"0":"1"; } output +="\n"; } - return output; + */ + enc->close(); + delete enc; + return output.str(); } bool Audio_analysis::init(int _channels,int _bits,int _samples, int _rate) { //need these to make sense of data |
