 |
AppletTalk.com Java discussions newsgroups
|
| View previous topic :: View next topic |
| Author |
Message |
nello Guest
|
Posted: Thu Feb 26, 2004 4:48 pm Post subject: suonare una clip |
|
|
salve io volevo solo suonare un file wav....
mi sono letto la documentazione della sun e sono giunto a scrivere queste
linee di codice che compilano ma non funzionano.
ho un errore quando faccio l'assegnazione alla variabile line.
qualcuno mi sa dire come posso fare allora a suonare un file?
grazie in anticipo
private TargetDataLine line;
try{
AudioFormat format = AudioSystem.getAudioInputStream( new File( new
File( "" ).getCanonicalPath( ) +
"/presa.wav") ).getFormat( );
line = ( TargetDataLine )AudioSystem.getLine( new DataLine.Info(
Clip.class, format ) );
line.open( format );
} catch( LineUnavailableException ex ) { }
catch (Exception ex) { }
line.start( );
|
|
| Back to top |
|
 |
|
|
You cannot post new topics in this forum You cannot reply to topics in this forum You cannot edit your posts in this forum You cannot delete your posts in this forum You cannot vote in polls in this forum
|
|