[Python] I can't get the sound to actually play

Discussão em 'Python' iniciado por Stack, Fevereiro 6, 2025.

  1. Stack

    Stack Membro Participativo

    So this is python. And I need help adding sound. I'm using CMU CS academy. And this is my current code-

    music = Sound('https://music.youtube.com/watch?v=HCslYhHcWkU&list=RDAMVMHCslYhHcWkU')

    def onKeyPress(key): if (key == 'p'):
    if (pausedLabel.value == 'Paused...'):
    pausedLabel.value = 'Playing!'
    music.play(loop=True)

    else:
    pausedLabel.value = 'Paused...'
    music.pause()

    Continue reading...

Compartilhe esta Página