diff options
author | Daniel Friesel <derf@finalrewind.org> | 2016-02-24 17:50:02 +0100 |
---|---|---|
committer | Daniel Friesel <derf@finalrewind.org> | 2016-02-24 17:50:02 +0100 |
commit | b4293fd7aa24bc020f901c7a383f3e87d34a3b76 (patch) | |
tree | c07609e11cb0f20831a6d7102320d039e7ab417b /utilities | |
parent | 6cc9c4fa5133e5b2e587735d2cd3cc9272fa7c8a (diff) |
add pattern transfer test code to blinkenrocket.py, speed up modem/receive
Diffstat (limited to 'utilities')
-rw-r--r-- | utilities/blinkenrocket.py | 19 | ||||
-rwxr-xr-x | utilities/modem_transmit | 4 |
2 files changed, 17 insertions, 6 deletions
diff --git a/utilities/blinkenrocket.py b/utilities/blinkenrocket.py index 01c7d73..c4cb488 100644 --- a/utilities/blinkenrocket.py +++ b/utilities/blinkenrocket.py @@ -91,6 +91,7 @@ class modem: sound += self.modemcode(ord(byte)) self.cnt += 1 if self.cnt == 10: + sound += self.silence(256) # TODO determine required amount of silence sound += self.generateSyncSignal(2) self.cnt = 0 # add some sync signals in the end @@ -219,9 +220,19 @@ class blinkenrocket(): if __name__ == '__main__': - m = modem(parity=True) - #print list(open(sys.argv[1]).read()) - m.setData(list(open(sys.argv[1]).read())) - m.saveAudio(sys.argv[2]) + m = modem(parity=True, frequency=16000) + b = blinkenrocket() + + b.addFrame(textFrame("Test Foo eins zwei drei")) + b.addFrame(textFrame("mrew? ")) + b.addFrame(textFrame("Und so weiter \x01 ")) + b.addFrame(animationFrame(map(lambda x : chr(x), [0, 0, 0, 0, 0, 0, 0, 0, 255, 255, 255, 255, 255, 255, 255, 255]))) + #for i in xrange(10): + # b.addFrame(textFrame(str(100*i))) + + m.setData(b.getMessage()) + m.saveAudio(sys.argv[1]) + + #print b.getMessage() diff --git a/utilities/modem_transmit b/utilities/modem_transmit index 8f85c78..362bc4d 100755 --- a/utilities/modem_transmit +++ b/utilities/modem_transmit @@ -2,7 +2,7 @@ OUT="$(mktemp)" -python blinkenrocket.py =(echo -n "$1"$'\0') $OUT +python blinkenrocket.py $OUT case "$(uname -s)" in Darwin) @@ -13,4 +13,4 @@ Darwin) ;; esac -rm $OUT
\ No newline at end of file +rm $OUT |