Afficher un message
Vieux 22/08/2007, 18h57   #1
firelink.east@gmail.com
Aucun Avatar
 
Messages: n/a
Hébergeur:
Par défaut Lire un sons en python

Voilà je débute en python je viens de terminer les leçon du cours Rur-
ple ( http://rur-ple.sourceforge.net/en/rur.htm ) très instructif on
y apprend en s'amusant des trucs comme -

- def , if , else elif , pass , not while , from and import object
oriented programing , tulpe , global , list , append , pop ,
dictionnary , str , int , class , del , return , for .. in , for ...
in .. range()
, join , len , designing new class , designing new class for change
the base of an existing class : __init__ , from 'module' import
'fonction' , from 'module' import * (all function of that module ) ,
try
,-

Même si je maitrise pas encore tout La premier programme que je
souhaite faire est un inutilitaire qui m'a bien fait rire il y a
quelque années mais dont j'ai pas encore vue l'équivalent en sous
Linux . Ce soft a pour but simplement différent sons prédéfinie
(Ahh , Ohh , Wow .. ) lors qu'on clique sur un bouton . Rien de bien
sorcier j'ai commencer à faire l'interface en TK , et voila lorsque
j'essaye de lui faire lire un sons (wav ou ogg ) rien ne sort . J'ai
testé différent module pyogg , pyvorbis , puis j'ai testé libsnack
( http://www.speech.kth.se/snack/) . Il semblerait lorsque je lance
les commande dans le prompt cela le lit (en ouvrant xmms en meme temps
je n'ai pas de sons car /dev/dsp occupé ) , sinon lorsque je lance le
script il me donne une erreur de syntaxe : soundtest():^
SyntaxError: invalid syntax
Script terminated. , voici mon code :

import sys
from Tkinter import *
root = Tk()
import tkSnack
tkSnack.initializeSnack(root)
mysound = tkSnack.Sound(load='/usr/share/xulrunner/res/samples/
test.wav')
soundtest():
mysound.play
fen = Tk()
fen.title("Fenêtre composée à l'aide de frames")
fen.geometry("157x178")
f1 = Frame(fen,bd =2, )
f1.pack(side = LEFT)
bou1=Button(f1, text='Ah')
bou1.pack()
bou2 =Button(f1, text='BoOOoo',command=soundtest)
bou2.pack()
bou3=Button(f1, text='Clapping')
bou3.pack()
bou4=Button(f1, text='Huh ? ')
bou4.pack()

f2 = Frame(fen, bd =2, )
f2.pack(side =RIGHT)
bou5=Button(f2, text='Bouton')
bou5.pack()
bou6=Button(f2, text='Bouton')
bou6.pack()
bou7=Button(f2, text='Bouton')
bou7.pack()
bou8=Button(f2, text='Bouton')
bou8.pack()
f3 = Frame(fen, bd =2, )
f3.pack(side = BOTTOM)

bou9=Button(f3, text='hello')
bou9.pack()

fen.mainloop()




merci d'avance

  Réponse avec citation
 
Page generated in 0,07132 seconds with 9 queries