[Tutor] read sound file via url
nmaleve at all2all.org
Thu Apr 15 20:06:21 EDT 2004
I make my first steps with the snack library.
I would like to make a python script to read an ogg file over the net.
At the moment the only solution I could manage to get working is to save the
file on disk and then read it.
For larger sound file, I would prefer to read them directly via a url.
Can anyone put me in the right direction?
here follows my script with the locally saved version...
#! /usr/bin/env python
# Usage: oggplay.py http://www.myserver.com/file.ogg
# Note: this script will also play audio files in any other format supported
# by tkSnack
from Tkinter import *
from tkSnack import *
# Load the Ogg/Vorbis format package
Tk().tk.eval('package require snackogg')
snd_net = file.read()
print "opening file for writing"
print "now trying to play\n"
print "does it exit now?"
print "Usage: oggplay.py http://www.myserver.com/file.ogg"
C O N S T A N T
V Z W
More information about the Tutor