diff --git a/.DS_Store b/.DS_Store index 5008ddf..f8ec3dc 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/same-with-webserver.py b/same-with-webserver.py index b8f7121..bf13005 100644 --- a/same-with-webserver.py +++ b/same-with-webserver.py @@ -90,11 +90,50 @@ class easSAMEHeader: # TODO: i could probably replace this with the bits() function - - - return byte_data + def generateSAMEAudio(code): + + # SAME HEADER (3x) + for i in range(0, 3): + signal = np.append(signal, preamble()) + + # turn each character into a sequence of sine waves + for char in code: + signal = np.append(signal, byte(char)) + + signal = np.append(signal, np.zeros(43750)) # wait the requisite one second + + # TODO: attention tone? + + # TODO: audio message? + + + # EOM (3x) + for i in range(0, 3): + signal = np.append(signal, preamble()) + + for char in "NNNN": # NNNN = End Of Message + signal = np.append(signal, byte(char)) + + signal = np.append(signal, np.zeros(43750)) # wait the requisite one second + + + # signal *= -32767 + + signal = np.int16(signal) + + wavfile.write(str("same.wav"), fs, signal) + + + # TODO: oh shit, I guess I need to think about multi-platform compatibility + def playLatestSAMEFIleOnMacOS(): + subprocess.call("afplay same.wav", shell=True) + + + + + @@ -115,47 +154,6 @@ code = "ZCZC-PEP-EAT-000000+0400-" + sameCompatibleTimestamp + "-SCIENCE -" # n # code = "SUCK MY F**KING B***S YOU F**KING C*********RS" # does not seem to work :'( -for i in range(0, 3): - # signal = np.append(signal, extramarks(10)) - signal = np.append(signal, preamble()) - - # turn each character into a sequence of sine waves - for char in code: - signal = np.append(signal, byte(char)) - - # signal = np.append(signal, extramarks(6)) # ENDEC might not be as picky about this as I once thought - - signal = np.append(signal, np.zeros(43750)) # wait the requisite one second - - -# EOM (3x) -for i in range(0, 3): - # signal = np.append(signal, extramarks(10)) - signal = np.append(signal, preamble()) - - for char in "NNNN": # NNNN = End Of Message - signal = np.append(signal, byte(char)) - - # signal = np.append(signal, extramarks(6)) - - signal = np.append(signal, np.zeros(43750)) # wait the requisite one second - - - - - - -signal *= -32767 - -signal = np.int16(signal) - -wavfile.write(str("same.wav"), fs, signal) - - -subprocess.call("afplay same.wav", shell=True) - - -def generateSAMEAudioBasedOnCode(sameCode): @@ -167,6 +165,8 @@ def requestHandler_samecode(_get): print urllib2.unquote(_get[2]) + # TODO: implement same code + # for client in clients: # client.write_message(json.dumps({"messagetype": "marquee", "message": urllib2.unquote(_get[2])})) diff --git a/same.aup b/same.aup new file mode 100644 index 0000000..1239a4e --- /dev/null +++ b/same.aup @@ -0,0 +1,255 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/same.py b/same.py index 78e3cbf..3b8d10c 100644 --- a/same.py +++ b/same.py @@ -132,7 +132,7 @@ sameCompatibleTimestamp = datetime.datetime.now().strftime("%j%H%M") #code = "ZCZC-PEP-EAN-000000+0400-" + sameCompatibleTimestamp + "-SCIENCE -" # nuclear armageddon (or some other form of "we are all likely to die") # code = "ZCZC-PEP-EAT-000000+0400-" + sameCompatibleTimestamp + "-SCIENCE -" # nuclear armageddon (or some other form of "we are all likely to die") # code = "ZCZC-PEP-EAT-000000+0400-2142350-SCIENCE -" # lol jk no nuclear armageddon -# code = "ZCZC-WXR-TOR-024031+0030-" + sameCompatibleTimestamp + "-SCIENCE -" # tornado warning, silver spring, md +code = "ZCZC-WXR-TOR-024031+0030-" + sameCompatibleTimestamp + "-SCIENCE -" # tornado warning, silver spring, md # code = "ZCZC-WXR-SVR-024031+0030-2142200-SCIENCE -" # severe thunderstorm warning, silver spring, md # code = "ZCZC-WXR-EVI-024031+0030-" + sameCompatibleTimestamp + "-SCIENCE -" # evacuation immediate!!, silver spring, md # code = "ZCZC-WXR-FFW-024031+0030-2150021-SCIENCE -" @@ -145,7 +145,7 @@ sameCompatibleTimestamp = datetime.datetime.now().strftime("%j%H%M") # code = "ZCZC-ROFL-WTF-012345+0000-YO WADDUP MOTHAFUCKAZ=" -code = args.code +# code = args.code diff --git a/same.wav b/same.wav index 22ce466..0961926 100644 Binary files a/same.wav and b/same.wav differ diff --git a/same_data/.DS_Store b/same_data/.DS_Store new file mode 100644 index 0000000..751b22a Binary files /dev/null and b/same_data/.DS_Store differ diff --git a/same_data/e00/.DS_Store b/same_data/e00/.DS_Store new file mode 100644 index 0000000..4051f90 Binary files /dev/null and b/same_data/e00/.DS_Store differ diff --git a/same_data/e00/d00/e0000012.au b/same_data/e00/d00/e0000012.au new file mode 100644 index 0000000..f80359b Binary files /dev/null and b/same_data/e00/d00/e0000012.au differ diff --git a/same_data/e00/d00/e00000a9.au b/same_data/e00/d00/e00000a9.au new file mode 100644 index 0000000..8cccb86 Binary files /dev/null and b/same_data/e00/d00/e00000a9.au differ diff --git a/same_data/e00/d00/e0000198.au b/same_data/e00/d00/e0000198.au new file mode 100644 index 0000000..850b0ce Binary files /dev/null and b/same_data/e00/d00/e0000198.au differ diff --git a/same_data/e00/d00/e00001e5.au b/same_data/e00/d00/e00001e5.au new file mode 100644 index 0000000..f6603ca Binary files /dev/null and b/same_data/e00/d00/e00001e5.au differ diff --git a/same_data/e00/d00/e0000275.au b/same_data/e00/d00/e0000275.au new file mode 100644 index 0000000..bd41ccb Binary files /dev/null and b/same_data/e00/d00/e0000275.au differ diff --git a/same_data/e00/d00/e00003ad.au b/same_data/e00/d00/e00003ad.au new file mode 100644 index 0000000..861da30 Binary files /dev/null and b/same_data/e00/d00/e00003ad.au differ diff --git a/same_data/e00/d00/e0000436.au b/same_data/e00/d00/e0000436.au new file mode 100644 index 0000000..ace010e Binary files /dev/null and b/same_data/e00/d00/e0000436.au differ diff --git a/same_data/e00/d00/e000046e.au b/same_data/e00/d00/e000046e.au new file mode 100644 index 0000000..be19457 Binary files /dev/null and b/same_data/e00/d00/e000046e.au differ diff --git a/same_data/e00/d00/e000047a.au b/same_data/e00/d00/e000047a.au new file mode 100644 index 0000000..9b4845d Binary files /dev/null and b/same_data/e00/d00/e000047a.au differ diff --git a/same_data/e00/d00/e000048c.au b/same_data/e00/d00/e000048c.au new file mode 100644 index 0000000..56d3776 Binary files /dev/null and b/same_data/e00/d00/e000048c.au differ diff --git a/same_data/e00/d00/e00005b1.au b/same_data/e00/d00/e00005b1.au new file mode 100644 index 0000000..92cd32c Binary files /dev/null and b/same_data/e00/d00/e00005b1.au differ diff --git a/same_data/e00/d00/e00006c9.au b/same_data/e00/d00/e00006c9.au new file mode 100644 index 0000000..a92c8d3 Binary files /dev/null and b/same_data/e00/d00/e00006c9.au differ diff --git a/same_data/e00/d00/e000071a.au b/same_data/e00/d00/e000071a.au new file mode 100644 index 0000000..1b0f6c5 Binary files /dev/null and b/same_data/e00/d00/e000071a.au differ diff --git a/same_data/e00/d00/e000072d.au b/same_data/e00/d00/e000072d.au new file mode 100644 index 0000000..068b581 Binary files /dev/null and b/same_data/e00/d00/e000072d.au differ diff --git a/same_data/e00/d00/e0000731.au b/same_data/e00/d00/e0000731.au new file mode 100644 index 0000000..4185d38 Binary files /dev/null and b/same_data/e00/d00/e0000731.au differ diff --git a/same_data/e00/d00/e0000741.au b/same_data/e00/d00/e0000741.au new file mode 100644 index 0000000..4e7e88a Binary files /dev/null and b/same_data/e00/d00/e0000741.au differ diff --git a/same_data/e00/d00/e00007a4.au b/same_data/e00/d00/e00007a4.au new file mode 100644 index 0000000..f8383b9 Binary files /dev/null and b/same_data/e00/d00/e00007a4.au differ diff --git a/same_data/e00/d00/e000094a.au b/same_data/e00/d00/e000094a.au new file mode 100644 index 0000000..f4aeedf Binary files /dev/null and b/same_data/e00/d00/e000094a.au differ diff --git a/same_data/e00/d00/e0000a44.au b/same_data/e00/d00/e0000a44.au new file mode 100644 index 0000000..ed8de01 Binary files /dev/null and b/same_data/e00/d00/e0000a44.au differ diff --git a/same_data/e00/d00/e0000b9b.au b/same_data/e00/d00/e0000b9b.au new file mode 100644 index 0000000..8665a0d Binary files /dev/null and b/same_data/e00/d00/e0000b9b.au differ diff --git a/same_data/e00/d00/e0000c5f.au b/same_data/e00/d00/e0000c5f.au new file mode 100644 index 0000000..33e3d27 Binary files /dev/null and b/same_data/e00/d00/e0000c5f.au differ diff --git a/same_data/e00/d00/e0000da6.au b/same_data/e00/d00/e0000da6.au new file mode 100644 index 0000000..b639bc9 Binary files /dev/null and b/same_data/e00/d00/e0000da6.au differ diff --git a/same_data/e00/d00/e0000f50.au b/same_data/e00/d00/e0000f50.au new file mode 100644 index 0000000..05834a6 Binary files /dev/null and b/same_data/e00/d00/e0000f50.au differ diff --git a/same_data/e00/d00/e0000f8c.au b/same_data/e00/d00/e0000f8c.au new file mode 100644 index 0000000..21278ec Binary files /dev/null and b/same_data/e00/d00/e0000f8c.au differ