def setUp(self): from os.path import join source = join('..', 'media', 'sampler.mp3') source_wav = mp3_to_wav(source) self.source_wav = source_wav self.input_fields = {'groovyness': 0.0} self.air = AudioRepr(source_wav, self.input_fields)
def setUp(self): from os.path import join source = join('..','media', 'sampler.mp3') source_wav = mp3_to_wav(source) # Create a temp file self.source_wav = source_wav # Store for later deletion! self.input_fields = {'groovyness' : 0} self.air = AudioRepr (source_wav, self.input_fields) self.phvoc = PhaseVocPR(self.air , self.input_fields)
def test_air_constructor_default_vals(self): try: from os.path import join source = join('..', 'media', 'sampler.mp3') source_wav = mp3_to_wav(source) air = AudioRepr(source_wav, {}) self.assertEqual(air._sampleRate, 0) self.assertEqual(air._bitDepth, 16) self.assertEqual(air._sampleMin, 0) self.assertEqual(air._sampleMax, 2**16) self.assertEqual(air._sampleType, int) self.assertEqual(air._audioFile, source_wav) os.remove(source_wav) # XXX: This should really be factored out into a setUp/tearDown pair of functions function except Exception as e: print("Caught Exception: {}".format(e)) # XXX How do I report exception to unittest? self.assertFalse(True)
def convert_file(self): ''' takes a filepath source and returns a new source in temp dir as a wav''' self.source = self.input_fields['source'] self.source_wav = mp3_to_wav(self.source)