Skip to content

Instantly share code, notes, and snippets.

@fernandolopez
Created May 27, 2014 18:01
Show Gist options
  • Save fernandolopez/0748f7b3d1cdc9c170dc to your computer and use it in GitHub Desktop.
Save fernandolopez/0748f7b3d1cdc9c170dc to your computer and use it in GitHub Desktop.
Ejemplos de audio
# Con archivos grandes tarda mucho hay que usar audios cortos
# hay otro ejemplo más completo en:
# http://www.stuartaxon.com/2008/02/24/playing-a-sound-in-pygame/
import pygame
import time
pygame.init()
sound = pygame.mixer.Sound('audiobook.ogg')
canal = sound.play()
time.sleep(10) # Reproducir por 10 segundos
canal.stop()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment