Пример #1
0
def file_handle(filename, ext):
    sound = core.Sound(filename, ext)
    voice = core.Voice(sound, loop=True)

    voice.play()

    def on_interrupt():
        """
        Handle subsequent keyboard interrupts:
        * 1st - toggle voice
        * 2nd - toggle voice again
        * 3rd - quit
        """
        global again

        if again >= 2:
            print("quiting")
            quit()

        else:
            again += 1
            voice.toggle()

    print(on_interrupt.__doc__)

    update_till_interrupt(on_interrupt)
Пример #2
0
def file_handle(filename, ext):
    sound = core.Sound(filename, ext)
    voice = core.Voice(sound, loop=True)

    voice.play()
    voice.pitch = 1.5
    voice.pan = -.5
    voice.gain = .5

    print("pitch: %5.1f" % voice.pitch)
    print("pan:   %5.1f" % voice.pan)
    print("gain:  %5.1f" % voice.gain)

    update_till_interrupt()
Пример #3
0
def file_handle(filename, ext):
    sound = core.Sound(filename, ext)
    sound.play(finished)

    update_till_interrupt()