Mercurial > hg > audio-degradation-toolbox
comparison html_gen/generate_html2.py @ 6:2a219bedc712
added very simple html generating python scripts
author | matthiasm |
---|---|
date | Wed, 21 Aug 2013 18:18:28 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
5:a4173509bc43 | 6:2a219bedc712 |
---|---|
1 import sys | |
2 | |
3 args = sys.argv | |
4 | |
5 html_top = '''<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" | |
6 "http://www.w3.org/TR/html4/loose.dtd"> | |
7 <html lang="en"> | |
8 <head> | |
9 <meta http-equiv="Content-Type" content="text/html; charset=utf-8"> | |
10 <title>untitled</title> | |
11 <meta name="generator" content="TextMate http://macromates.com/"> | |
12 <meta name="author" content="Matthias Mauch"> | |
13 <!-- Date: 2013-08-20 --> | |
14 </head> | |
15 <body style = "background:#ddd;"> | |
16 <div style="padding:20px;"> | |
17 <h2>Audio Degradation Toolbox -- Examples</h2>''' | |
18 | |
19 html_original = \ | |
20 '''<p style="background:#ea5;"> | |
21 <audio controls> | |
22 <source src="../demoOutput/{1}_{0}.wav" type="audio/wav"> | |
23 Your browser does not support the audio element. | |
24 </audio> | |
25 {1}</p>''' | |
26 | |
27 html_middle = \ | |
28 '''<p> | |
29 <audio controls> | |
30 <source src="../demoOutput/{1}_{0}.wav" type="audio/wav"> | |
31 Your browser does not support the audio element. | |
32 </audio> | |
33 {1}</p>''' | |
34 | |
35 html_bottom = '''</div></body> | |
36 </html>''' | |
37 | |
38 | |
39 fileids = ["file{0}".format(i) for i in range(1,8)] | |
40 | |
41 degids = ['Unit_01_addNoise', | |
42 'Unit_02_addSound', | |
43 'Unit_03_applyAliasing', | |
44 'Unit_04_applyClipping', | |
45 'Unit_05_applyDynamicRangeCompression', | |
46 'Unit_06_applyHarmonicDistortion', | |
47 'Unit_07_applyMp3Compression', | |
48 'Unit_08_applySpeedup', | |
49 'Unit_09_applyWowResampling', | |
50 'Degr_01_liveRecording', | |
51 'Degr_02_strongMp3Compression', | |
52 'Degr_03_vinylRecording', | |
53 'Degr_04_radioBroadcast', | |
54 'Degr_05_smartPhoneRecording', | |
55 'Degr_06_smartPhonePlayback',] | |
56 | |
57 print html_top | |
58 for fid in fileids: | |
59 print "<h3>{0}</h3>".format(fid) | |
60 print html_original.format(fid, "00_Original") | |
61 for did in degids: | |
62 print html_middle.format(fid, did) | |
63 print '''<br> | |
64 <br>''' | |
65 print html_bottom |