The following third party applications or libraries are required:
python (>= 2.3.5-7), python-xml, python-mutagen, python-django (>= 1.0-1),
-python-imaging (>= 1.1.6), sox, vorbis-tools, flac, normalize-audio,
+python-imaging (>= 1.1.6), sox (>= 14.2), vorbis-tools, flac, normalize-audio,
python-mysqldb, mysql-server, octave2.9, python-tk, libgd2-xpm,
libsndfile1 (>= 1.0.17), python-numpy, python-ctypes (>= 1.0.1),
python-scikits-audiolab (>= 0.7), python-setuptools (>= 0.6b3),
# ============
python (>= 2.3.5-7), python-xml, python-mutagen, python-django (>= 1.0-1),
-python-imaging (>= 1.1.6), sox, vorbis-tools, flac, normalize-audio,
+python-imaging (>= 1.1.6), sox (>= 14.2), vorbis-tools, flac, normalize-audio,
python-mysqldb, mysql-server, octave2.9, python-tk, libgd2-xpm,
libsndfile1 (>= 1.0.17), python-numpy, python-ctypes (>= 1.0.1),
python-scikits-audiolab (>= 0.7), python-setuptools (>= 0.6b3),
self.args = self.get_args(options)
self.ext = self.get_file_extension()
self.args = ' '.join(self.args)
- self.command = 'sox "%s" -s -q -r 44100 -t wav -c2 - | lame %s -' % (self.source, self.args)
+ self.command = 'sox "%s" -s -q -b 16 -r 44100 -t wav -c2 - | lame %s -' % (self.source, self.args)
#self.command = 'lame %s "%s" -' % (self.args, self.source)
# Pre-proccessing
self.args = self.get_args(options)
self.ext = self.get_file_extension()
self.args = ' '.join(self.args)
- self.command = 'sox "%s" -s -q -r 44100 -t wav -c2 - | oggenc %s -' % (self.source, self.args)
+ self.command = 'sox "%s" -s -q -b 16 -r 44100 -t wav -c2 - | oggenc %s -' % (self.source, self.args)
# Pre-proccessing
self.dest = self.pre_process(self.item_id,
end
%fftn = 2^nextpow2(window); % next highest power of 2
-[S, f, t] = spectrogram(x, Fs, window, step, 4000, 'hanning', -30);
+[S, f, t] = spectrogram(x, Fs, window, step, 8000, 'hanning', -30);
S = flipud(20*log10(S));
%
% cmap = [0:1:ncmap-1];
self.source_dir = source_dir
self.source_files = os.listdir(self.source_dir)
self.media_filter()
- print self.source_files
+ #print self.source_files
self.item_media_root_dir = settings.MEDIA_ROOT
self.item_media_full_dir = self.item_media_root_dir + os.sep + 'items'
- self.collection_id = self.get_collection()
def media_filter(self):
files = []
files.append(media_file)
self.source_files = files
- def get_collection(self):
- from telemeta.models import MediaItem
- file_0 = self.source_files[0]
- id_string = get_media_name(file_0)
- self.item_list = MediaItem.objects.filter(id__startswith=id_string)
- return self.item_list[0].collection_id
-
def media_import(self):
from telemeta.models import MediaItem
id_list = map(get_media_name, self.source_files)
-
- print "Working on collection_id : " + self.collection_id
+ #print id_list
+
for item_id in id_list:
+ item_id = item_id.strip()
print "item_id : " + item_id
it = MediaItem.objects.get(id=item_id)
source_full_path = self.source_dir + os.sep + get_item_in_list(self.source_files, item_id)
media = open(source_full_path, 'r')
f = File(media)
print "Adding : " + source_full_path
- try:
- it.file.save(f.name, f, save=True)
- except:
- raise TelemetaMediaImportError("Could not include this item: " + item_id)
+ it.file.save(f.name, f, save=True)
media.close()
def main(self):
project_dir: the directory of the Django project which hosts Telemeta
source_dir: the directory containing all media files to include
- IMPORTANT: each file name without its extension has to correspond at least to one existing item id in the database. All media files have also to correspond to only one Collection."
+ IMPORTANT: each file name without its extension has to correspond at least to one existing item id in the database."
""" % tool_name
def run():