[Shtoom] echoaudio patch

Stefan Alfredsson Stefan.Alfredsson at kau.se
Fri Oct 28 15:14:08 CEST 2005


When using the 'echo' audio driver, shtoom exists with an exception:

          File "/tmp/sl/shtoom/shtoom/app/phone.py", line 76, in play_wav_file

          File "/tmp/sl/shtoom/shtoom/audio/converters.py", line 328, in playWaveFile
            if not self._d.isOpen():
        exceptions.AttributeError: EchoAudioDevice instance has no attribute 'isOpen'

The following patch makes EchoAudioDevice inherit AudioDevice, just as
the other drivers, and therefore also the isOpen().

$ svn diff echoaudio.py
Index: echoaudio.py
--- echoaudio.py        (revision 1651)
+++ echoaudio.py        (working copy)
@@ -2,11 +2,12 @@
 # A special audio device. It merely echoes back what you send it.
+import baseaudio
 from converters import MediaLayer
 opened = None
-class EchoAudioDevice:
+class EchoAudioDevice(baseaudio.AudioDevice):
     def __init__(self):
         self._data = ''

More information about the Shtoom mailing list