Exemple #1
0
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)
Exemple #2
0
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))


Exemple #4
0
def play(freq):
    time = 0.5
    n = audiogen.sampler.play(audiogen.tone(freq), blocking=False)
    time.sleep(time)
    n.close()
Exemple #5
0
import audiogen

audiogen.sampler.play(audiogen.tone(20000))
Exemple #6
0
def tone_for(seconds):
    tone = audiogen.crop(audiogen.util.volume(audiogen.tone(HERTZ), -3),
                         seconds)
    return tone
Exemple #7
0
"""
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
Exemple #8
0
def tone_for(seconds):
	tone = audiogen.crop(audiogen.util.volume(audiogen.tone(HERTZ), -3), seconds)
	return tone
Exemple #9
0
import audiogen
from audiogen import *
import sys

if __name__ == "__main__":

    audiogen.sampler.write_wav(sys.stdout, audiogen.tone(440))
Exemple #10
0
#!/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)),
    ]))
Exemple #11
0
import audiogen

audiogen.sampler.play(audiogen.tone(440))
Exemple #12
0
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??