A Blog About Anime, Code, and Pr0 H4x

Speaker Beep

October 8, 2011 at 12:00 PM

This is a Python module that can play noises on a motherboard's internal speaker on computers running Windows.

Usage:

# Play the Final Fantasy victory medley
          import speaker_beep
          octave = 4
          speaker_beep.play_note(octave + 1, "c", "triplet")
          speaker_beep.play_note(octave + 1, "c", "triplet")
          speaker_beep.play_note(octave + 1, "c", "triplet")
          speaker_beep.play_note(octave + 1, "c", "quarter")
          speaker_beep.play_note(octave, "g#", "quarter")
          speaker_beep.play_note(octave, "a#", "quarter")
          speaker_beep.play_note(octave + 1, "c", "dotted_eigth")
          speaker_beep.play_note(octave, "a#", "sixteenth")
          speaker_beep.play_note(octave + 1, "c", "whole")
          

Download: speaker_beep.py

Go to Page