Bläddra i källkod

How was drums.py working...

Also minorly improved stability of mkiv.py
Graham Northup 8 år sedan
förälder
incheckning
12f9e5ecaa
2 ändrade filer med 5 tillägg och 2 borttagningar
  1. 1 1
      drums.py
  2. 4 1
      mkiv.py

+ 1 - 1
drums.py

@@ -123,7 +123,7 @@ if options.test:
         print 'Current playing:', PLAYING
         print 'Playing:', frq
         data = DRUMS[frq]
-        PLAYING.add(SampleReader(data, len(data), 1.0))
+        PLAYING.append(SampleReader(data, len(data), 1.0))
         time.sleep(len(data) / (4.0 * options.rate))
     print 'Done'
     exit()

+ 4 - 1
mkiv.py

@@ -691,7 +691,10 @@ for fname in args:
         ivtext = ET.SubElement(ivstreams, 'stream', type='text')
         for tev in textstream:
             text = tev.ev.text
-            text = text.decode('utf8')
+            try:
+                text = text.decode('utf8')
+            except UnicodeDecodeError:
+                text = 'base64:' + text.encode('base64')
             ivev = ET.SubElement(ivtext, 'text', time=str(tev.abstime), type=type(tev.ev).__name__, text=text)
 
     ivaux = ET.SubElement(ivstreams, 'stream')