def soundSend(): #Generators for each of the pitches. Need to adjust numbers #zeroGen = (audiogen.util.crop(audiogen.tone(1000), .2)) #oneGen = (audiogen.util.crop(audiogen.tone(2000), .2)) #controlGen = (audiogen.util.crop(audiogen.tone(3000), .2)) #audiogen.sampler.play(zeroGen) # open file with secret message with open(sys.argv[2], 'rb') as f, nullPrint(): byte = f.read(1) mask = 1 char = 'a' #wait for the other side to start time.sleep(1) # process 1 byte at a time while len(byte) > 0: bit = 0 # convert ascii into decimal equivalent byte = ord(byte) # convert decimal byte into binary bits # play corresponding tone for each bit for i in reversed(range(8)): bit = (mask & (byte >> i)) if bit == 0: audiogen.sampler.play( audiogen.util.crop(audiogen.tone(1000), .2), True) else: audiogen.sampler.play( audiogen.util.crop(audiogen.tone(2000), .2), True) byte = f.read(1) # play tone signaling eof audiogen.sampler.play(audiogen.util.crop(audiogen.tone(3000), .4), True)
def sound(): """ base sound to use :return: sine wave at 150Hz """ return tone(150)
import audiogen from audiogen import * import sys if __name__ == "__main__": audiogen.sampler.write_wav(sys.stdout, audiogen.tone(440))
def play(freq): time = 0.5 n = audiogen.sampler.play(audiogen.tone(freq), blocking=False) time.sleep(time) n.close()
import audiogen audiogen.sampler.play(audiogen.tone(20000))
def tone_for(seconds): tone = audiogen.crop(audiogen.util.volume(audiogen.tone(HERTZ), -3), seconds) return tone
""" Solfeggio Frequencies """ import audiogen chakras = {'first':'174','second':'285','third':'396','fourth':'417','fifth':'528','sixth':'639','seventh':'741','eigth':'852','nineth':'963'} for chakra in chakras: try: audiogen.sampler.play(audiogen.tone(int(chakras.get(chakra,"")))) except: pass
#!/usr/bin/python import audiogen import sys from audiogen.util import constant #audiogen.sampler.write_wav(sys.stdout, audiogen.tone(440)) audiogen.sampler.play( audiogen.util.mixer((audiogen.tone(50), audiogen.tone(52)), [ (constant(0.3), constant(0.3)), ]))
import audiogen audiogen.sampler.play(audiogen.tone(440))
import audiogen from note_freqs import getFreq print getFreq('F#4') print getFreq('E4') import time # This is using the old method: audiogen.sampler.play(audiogen.tone(getFreq('F#4'))) # from davy wybiral's script we can do the same thing using waveforms: # but how exactly??