Changeset 919:2ce8ca39525b for src/mlx/sound.py
- Timestamp:
- 03/24/19 08:15:59 (5 years ago)
- Branch:
- python3
- hg-Phase:
- (<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
src/mlx/sound.py
r800 r919 1 1 2 from util import utf2unicode2 from .util import utf2unicode 3 3 4 4 import os … … 113 113 success = True 114 114 try: 115 print "Closing", alias115 print("Closing", alias) 116 116 self._mci.send("close " + alias) 117 print "Closed", alias118 except Exception ,e:119 print "Failed closing " + alias + ":",120 print utf2unicode(str(e))117 print("Closed", alias) 118 except Exception as e: 119 print("Failed closing " + alias + ":", end=' ') 120 print(utf2unicode(str(e))) 121 121 success = False 122 122 … … 130 130 try: 131 131 alias = "mlxsound%d" % (counter,) 132 print "Starting to play", path, "as", alias132 print("Starting to play", path, "as", alias) 133 133 self._mci.send("open \"%s\" alias %s" % \ 134 134 (path, alias)) … … 144 144 self._pending.append((timeout, (alias, finishData))) 145 145 self._pending.sort() 146 print "Started to play", path147 except Exception ,e:148 print "Failed to start playing " + path + ":",149 print utf2unicode(str(e))146 print("Started to play", path) 147 except Exception as e: 148 print("Failed to start playing " + path + ":", end=' ') 149 print(utf2unicode(str(e))) 150 150 (finishCallback, extra) = finishData 151 151 if finishCallback is not None: … … 220 220 221 221 Gst.init(None) 222 except Exception ,e:222 except Exception as e: 223 223 outQueue.put(False) 224 224 outQueue.put(e) … … 351 351 else: 352 352 exception = _inQueue.get() 353 print "The Gst library is missing from your system. It is needed for sound playback on Linux:"354 print exception353 print("The Gst library is missing from your system. It is needed for sound playback on Linux:") 354 print(exception) 355 355 356 356 def startSound(name, finishCallback = None, extra = None): … … 387 387 388 388 def callback(result, extra): 389 print "callback", result, extra389 print("callback", result, extra) 390 390 391 391 preInitializeSound() … … 393 393 soundsPath = os.path.abspath(os.path.join(os.path.dirname(os.path.abspath(__file__)), 394 394 "..", "..", "sounds")) 395 print "soundsPath:", soundsPath395 print("soundsPath:", soundsPath) 396 396 initializeSound(soundsPath) 397 397 startSound("notam.mp3", finishCallback = callback, extra= "notam.mp3")
Note:
See TracChangeset
for help on using the changeset viewer.