def METHOD_NAME(task):
    sample_freq = int(task.generator.rate)
    sample_count = int(task.generator.frames)
    channels = int(task.generator.channels)
    f = wave.open(task.outputs[0].abspath(), "wb")
    f.setnchannels(channels)
    f.setsampwidth(2)
    f.setframerate(sample_freq)
    buf = io.BytesIO()
    frames = []
    for i in range(sample_count):
        a = 0.8 * 32768
        if channels == 1:
            buf.write(struct.pack('h', int(a)))
        else:
            buf.write(struct.pack('hh', int(a), int(a)))
    f.writeframes(buf.getvalue())
    f.close()
    return 0