Go to the documentation of this file.00001
00183 #include <iostream>
00184 #include <cmath>
00185 #include <cassert>
00186
00187 #include "soundfile.hpp"
00188 #include "mainwindow.hpp"
00189 #include "spectrogram.hpp"
00190
00191
00192 namespace
00193 {
00194 void image_test()
00195 {
00196
00197 Soundfile file("/home/jan/music/Windir/1999-Arntor/01-Byrjing.mp3");
00198 Spectrogram spec;
00199
00200 real_vec signal = file.read_channel(0);
00201 QImage out = spec.to_image(signal, file.data().samplerate());
00202 out.save("out.png");
00203 }
00204
00205 void synt_test()
00206 {
00207 QImage img = QImage("/home/jan/spectrogram/out.png");
00208
00209 assert(!img.isNull());
00210 Spectrogram spec;
00211 real_vec data = spec.synthetize(img, 44100, SYNTHESIS_SINE);
00212 std::cout << "hotovo: "<<data.size()<<"\n";
00213
00214 }
00215 }
00216
00217 int main(int argc, char* argv[])
00218 {
00219
00220
00221
00222 QApplication app(argc, argv);
00223 MainWindow main_window;
00224 main_window.show();
00225 return app.exec();
00226 }