Mercurial > hg > dml-open-backendtools
comparison pyspark/decode_to_wav.py @ 0:e34cf1b6fe09 tip
commit
author | Daniel Wolff |
---|---|
date | Sat, 20 Feb 2016 18:14:24 +0100 |
parents | |
children |
comparison
equal
deleted
inserted
replaced
-1:000000000000 | 0:e34cf1b6fe09 |
---|---|
1 # Part of DML (Digital Music Laboratory) | |
2 # | |
3 # This program is free software; you can redistribute it and/or | |
4 # modify it under the terms of the GNU General Public License | |
5 # as published by the Free Software Foundation; either version 2 | |
6 # of the License, or (at your option) any later version. | |
7 # | |
8 # This program is distributed in the hope that it will be useful, | |
9 # but WITHOUT ANY WARRANTY; without even the implied warranty of | |
10 # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | |
11 # GNU General Public License for more details. | |
12 # | |
13 # You should have received a copy of the GNU General Public | |
14 # License along with this library; if not, write to the Free Software | |
15 # Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA | |
16 | |
17 #!/usr/bin/python | |
18 # -*- coding: utf-8 -*- | |
19 | |
20 __author__="wolffd" | |
21 __date__ ="$21-Jul-2014 15:36:41$" | |
22 | |
23 # -*- coding: utf-8 -*- | |
24 #from timeside.decoder import * | |
25 #from timeside.encoder import * | |
26 #import os.path | |
27 #import sys | |
28 # now use a regular timeside installation, e.g. installed by | |
29 #sys.path.append(os.getcwd() + '/../TimeSide/') | |
30 | |
31 from timeside.decoder.file import * | |
32 from timeside.encoder.wav import * | |
33 | |
34 def decode_to_wav(source = 'sweep.flac'): | |
35 if source[-4:] == ".wav" : | |
36 dest = source | |
37 print "already converted: " + dest | |
38 | |
39 else: | |
40 dest = source + '.wav' | |
41 decoder = FileDecoder(source) | |
42 encoder = WavEncoder(dest, overwrite=True) | |
43 (decoder | encoder).run() | |
44 print "decoded: " + dest | |
45 return dest |