Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # audio_rec_and_play.py
- import time
- import audio
- import os
- print "Audio Demo --"
- dir_audio = (u"e:\\audiotest.wav")
- s = audio.Sound.open(dir_audio)
- print dir(s)
- s.record()
- print "5 SECONDS OF RECORDING IS NOW COMMENCED..."
- time.sleep(5)
- s.stop()
- print "WILL NOW PLAY THE RECORDED AUDIO..."
- time.sleep(2)
- s.play()
- time.sleep(5)
- s.close()
- os.remove(dir_audio) # first needs to be closed
- print "Done!"
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement