示例#1
0
文件: main.py 项目: NISH1001/humT
def main():
    # start recording -> 5 sec default
    recorder = Recorder()
    frames = recorder.start(5)
    recorder.write_wav(frames, "input.wav")

    # load the hum and process
    hum = track_pitch("input.wav")
    timeseries(hum)
    process(hum)
    """
示例#2
0
文件: main.py 项目: NISH1001/humT
def main():
    # start recording -> 5 sec default
    recorder = Recorder()
    frames = recorder.start(5)
    recorder.write_wav(frames, "input.wav")

    # load the hum and process
    hum = track_pitch("input.wav")
    timeseries(hum)
    process(hum)

    """
示例#3
0
文件: database.py 项目: NISH1001/humT
def store(wavefile, alias):
    print("extracting pitches...")
    data = load()
    data[alias] = {}
    if data[alias]:
        return

    d = {}
    d['wavefile'] = wavefile
    d['pitches'] = track_pitch(wavefile)
    data[alias] = d
    datastr = json.dumps(data, indent=4)
    open("storage.json", "w").write(datastr)
示例#4
0
文件: database.py 项目: NISH1001/humT
def store(wavefile, alias):
    print("extracting pitches...")
    data = load()
    data[alias] = {}
    if data[alias]:
        return

    d = {}
    d['wavefile'] = wavefile
    d['pitches'] = track_pitch(wavefile)
    data[alias] = d
    datastr = json.dumps(data, indent=4)
    open("storage.json", "w").write(datastr)