Skip to content

Instantly share code, notes, and snippets.

@scottwegner
scottwegner / rpi-inter-announce-03-14-14
Created March 14, 2014 18:07
Python code use for Raspberry Pi Intermission / Announce Device
import thread # the usual suspects of imports
from time import sleep
import RPi.GPIO as GPIO
import pygame.mixer
import random
from sys import exit
pygame.mixer.init(44100, -16, 1, 1024) # set up the mixer
announceAudio = pygame.mixer.Sound("seats-1.wav") # initially give announceAudio a value
soundChannelA = pygame.mixer.Channel(1) # initialize a mixer channel