Merge pull request #20 from chadberg/master
Resolve case where _peakdB is None
This commit is contained in:
@@ -329,6 +329,8 @@ class EncodeTask(ctask.GstPipelineTask):
|
|||||||
|
|
||||||
self.warning('No peak found.')
|
self.warning('No peak found.')
|
||||||
|
|
||||||
|
self.peak = 0.0
|
||||||
|
|
||||||
if self._duration:
|
if self._duration:
|
||||||
self.warning('GStreamer level element did not send messages.')
|
self.warning('GStreamer level element did not send messages.')
|
||||||
# workaround for when the file is too short to have volume ?
|
# workaround for when the file is too short to have volume ?
|
||||||
@@ -336,7 +338,6 @@ class EncodeTask(ctask.GstPipelineTask):
|
|||||||
self.warning('only one frame of audio, setting peak to 0.0')
|
self.warning('only one frame of audio, setting peak to 0.0')
|
||||||
self.peak = 0.0
|
self.peak = 0.0
|
||||||
|
|
||||||
|
|
||||||
class TagReadTask(ctask.GstPipelineTask):
|
class TagReadTask(ctask.GstPipelineTask):
|
||||||
"""
|
"""
|
||||||
I am a task that reads tags.
|
I am a task that reads tags.
|
||||||
|
|||||||
@@ -430,10 +430,9 @@ Install pycdio and run 'rip offset find' to detect your drive's offset.
|
|||||||
number)
|
number)
|
||||||
raise
|
raise
|
||||||
|
|
||||||
self.stdout.write('Peak level: %.2f %%\n' % (
|
self.stdout.write('Peak level: {:.2%} \n'.format(math.sqrt(trackResult.peak)))
|
||||||
math.sqrt(trackResult.peak) * 100.0, ))
|
|
||||||
self.stdout.write('Rip quality: %.2f %%\n' % (
|
self.stdout.write('Rip quality: {:.2%}\n'.format(trackResult.quality))
|
||||||
trackResult.quality * 100.0, ))
|
|
||||||
|
|
||||||
# overlay this rip onto the Table
|
# overlay this rip onto the Table
|
||||||
if number == 0:
|
if number == 0:
|
||||||
|
|||||||
Reference in New Issue
Block a user