예제 #1
0
        # print '%r' %packet
        # print '\tduration: %s' % format_time(packet.duration, packet.stream.time_base)
        # print '\tpts: %s' % format_time(packet.pts, packet.stream.time_base)
        # print '\tdts: %s' % format_time(packet.dts, packet.stream.time_base)
        out_container.mux(packet)
        if should_close.is_set():
            break

    out_container.close()


if __name__ == '__main__':
    logging.basicConfig(level=logging.DEBUG)

    from audio_capture import Audio_Capture
    cap = Audio_Capture('test.wav','default')

    import time
    time.sleep(5)
    cap.cleanup()
    # mic device
    exit()

    # container = av.open('hw:0',format="alsa")
    container = av.open('1:0',format="avfoundation")
    print('container:', container)
    print('\tformat:', container.format)
    print('\tduration:', float(container.duration) / av.time_base)
    print('\tmetadata:')
    for k, v in sorted(container.metadata.items()):
        print('\t\t{}: {!r}'.format(k, v))
예제 #2
0
        # print '\tduration: %s' % format_time(packet.duration, packet.stream.time_base)
        # print '\tpts: %s' % format_time(packet.pts, packet.stream.time_base)
        # print '\tdts: %s' % format_time(packet.dts, packet.stream.time_base)
        out_container.mux(packet)
        if should_close.is_set():
            break

    out_container.close()


if __name__ == "__main__":
    logging.basicConfig(level=logging.DEBUG)

    from audio_capture import Audio_Capture

    cap = Audio_Capture("test.wav", "default")

    import time

    time.sleep(5)
    cap.cleanup()
    # mic device
    exit()

    # container = av.open('hw:0',format="alsa")
    container = av.open("1:0", format="avfoundation")
    print("container:", container)
    print("\tformat:", container.format)
    print("\tduration:", float(container.duration) / av.time_base)
    print("\tmetadata:")
    for k, v in sorted(container.metadata.items()):
예제 #3
0
        # print '%r' %packet
        # print '\tduration: %s' % format_time(packet.duration, packet.stream.time_base)
        # print '\tpts: %s' % format_time(packet.pts, packet.stream.time_base)
        # print '\tdts: %s' % format_time(packet.dts, packet.stream.time_base)
        out_container.mux(packet)
        if should_close.is_set():
            break

    out_container.close()


if __name__ == '__main__':
    logging.basicConfig(level=logging.DEBUG)

    from audio_capture import Audio_Capture
    cap = Audio_Capture('test.wav', 'default')

    import time
    time.sleep(5)
    cap.cleanup()
    # mic device
    exit()

    # container = av.open('hw:0',format="alsa")
    container = av.open('1:0', format="avfoundation")
    print('container:', container)
    print('\tformat:', container.format)
    print('\tduration:', float(container.duration) / av.time_base)
    print('\tmetadata:')
    for k, v in sorted(container.metadata.items()):
        print('\t\t{}: {!r}'.format(k, v))