tu dois mal envoyer le lie pour downloader le son, tu envoi quoi comme lien ???
-------------------------------
Réponse au message :
-------------------------------
> Rebonsoir, je viens à nouveau vous embeter avec mes questions ;-)
>
> J'ai programmé une petite classe sound pour lire facilement des fichiers wav mais[vous vous attendiez quand même pas à ce que ca marche du 1er coup :-p] lors de la création demon object Sound, j'obtient une MalformedURLException no protocol: monSon.wav
>
> J'ai cherché[un peu] dans l'aide du JDK, mais je trouve rien qui correspond.
> Si qqun arriver à me dire d'ou vient cette erreur, ca m'aiderait bcps.
>
>
>
> /************************************************* > > Nom : Sound.java > Auteur : Switch - switch@netplus.ch > Date : 26/07/03 > Version : test > Descr. : Objet Sound permettant de jouer un son wav facilement > Bug : Creation d'un objet > Sound monSon = new Sound("monSon.wav") ; > > => > > java.net.MalformedURLException: > no protocol: monSon.wav > > ************************************************/ > import java.applet.Applet ; > import java.applet.AudioClip ; > import java.net.URL ; > import java.net.MalformedURLException ; > > public class Sound > { > private URL file ; > private AudioClip sound ; > > public Sound(String name) throws MalformedURLException > { > try > { > file = new URL(name) ; > sound = Applet.newAudioClip(file) ; > } > catch (MalformedURLException e) > { > System.err.println("Unable to select targeted file") ; > } > } > > public URL getFile() > {return file ;} > > public AudioClip getSound() > {return sound ;} > > public void setFile(String name) > { > try > { > file = new URL(name) ; > } > catch (MalformedURLException e) > { > System.err.println("Unable to select targeted sound") ; > } > } > > public void setSound(URL file) > {sound = Applet.newAudioClip(file) ;} > > public void playSound() > {sound.play() ;} > > public void loopSound() > {sound.loop() ;} > > public void stopSound() > {sound.stop() ;} > } > |
>
> Voila, si qqun trouve la solution, j'en fairai un petit zip avec la source pour le site.
> Merci