utils
Class SoundPlayer

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--utils.SoundPlayer
All Implemented Interfaces:
Runnable, Serializable

public class SoundPlayer
extends Thread
implements Serializable

Title: the Wondrous Farm
Description: Classe permettant de jouer des sons de type WAV, AU ou MIDI.
Copyright: Copyright (c) 2002
Company: minfo

See Also:
Serialized Form

Field Summary
private  InputStream ais
           
private  com.sun.media.sound.JavaSoundAudioClip clip
           
 
Fields inherited from class java.lang.Thread
contextClassLoader, daemon, eetop, group, inheritableThreadLocals, inheritedAccessControlContext, MAX_PRIORITY, MIN_PRIORITY, name, NORM_PRIORITY, priority, single_step, stillborn, stopThreadPermission, target, threadInitNumber, threadLocals, threadQ
 
Constructor Summary
SoundPlayer(URL sndURL)
          L'URL passée en paramètre contient bien sur le fichier son.
Si on veut jouer le fichier toto.wav qui se trouve dans C:\MesSons, l'URL est file:/C:/MesSons/toto.wav
 
Method Summary
 void play()
          Jouer le son.
 void stopPlaying()
          Arréter de le jouer.
 
Methods inherited from class java.lang.Thread
, activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, exit, getContextClassLoader, getName, getPriority, getThreadGroup, init, interrupt, interrupt0, interrupted, isAlive, isDaemon, isInterrupted, isInterrupted, join, join, join, nextThreadNum, registerNatives, resume, resume0, run, setContextClassLoader, setDaemon, setName, setPriority, setPriority0, sleep, sleep, start, stop, stop, stop0, suspend, suspend0, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

ais

private InputStream ais

clip

private com.sun.media.sound.JavaSoundAudioClip clip
Constructor Detail

SoundPlayer

public SoundPlayer(URL sndURL)
L'URL passée en paramètre contient bien sur le fichier son.
Si on veut jouer le fichier toto.wav qui se trouve dans C:\MesSons, l'URL est file:/C:/MesSons/toto.wav
Parameters:
sndURL: - là où se trouve le fichier sonore.
Method Detail

play

public void play()
Jouer le son.

stopPlaying

public void stopPlaying()
Arréter de le jouer.