Bonjour, je veux télécharger un son .wav depuis un serveur ftp et ensuite le lire. J'ai tapé ce code, mais apparemment aucun fichier .wav n'est téléchargé. Mais il me télécharge les .jpg. Comment puis-je faire?

voici mon code (ce fichier est un jFrame):
Code : Sélectionner tout - Visualiser dans une fenêtre à part
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
 
package audio_sec;
 
import java.awt.*;
import java.util.logging.Level;
import java.util.logging.Logger;
import javax.media.*;
import java.lang.*;
 
 
 
public class AudioPlayer extends javax.swing.JFrame {
 
 
    /** Creates new form AudioPlayer */
    public AudioPlayer() {
        initComponents();
    }
 
 
 
private Player player;
 
private String audioFile;
 
 
 
public AudioPlayer(String audioFile) {
    this.audioFile = audioFile;
}
 
 
//Méthode permettant de démarrer la lecture
 
public void start() throws Exception {
// création d'un player à partir d'un fichier source
 
 
    player = Manager.createPlayer(new MediaLocator(audioFile));
 
    // ajout d'un listener afin de contrôler les états
    // utilisation d'une classe anonyme pour le ControllerListener
player.addControllerListener(new ControllerListener() {
 
public void controllerUpdate(ControllerEvent controllerEvent) {
    // fin d'initialisations 
    if(controllerEvent instanceof RealizeCompleteEvent) {
        player.start();
    }
    // fin de lecture
    else if (controllerEvent instanceof EndOfMediaEvent) { 
        System.out.println("Fin de lecture : " + audioFile);
    }
}
});
 
player.realize();
}
 
 
//Arrêt lecture
 
public void stop() {
    if(player != null) {
        player.stop();
    }
} 
 
    // <editor-fold defaultstate="collapsed" desc="Generated Code">                          
    private void initComponents() {
 
        jButtonStart = new javax.swing.JButton();
        jButtonStop = new javax.swing.JButton();
 
        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
 
        jButtonStart.setText("Jouer son");
        jButtonStart.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonStartActionPerformed(evt);
            }
        });
 
        jButtonStop.setText("Arrêter son");
        jButtonStop.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                jButtonStopActionPerformed(evt);
            }
        });
 
        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(80, 80, 80)
                .addComponent(jButtonStart)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 77, Short.MAX_VALUE)
                .addComponent(jButtonStop)
                .addGap(77, 77, 77))
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(layout.createSequentialGroup()
                .addGap(134, 134, 134)
                .addGroup(layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(jButtonStart)
                    .addComponent(jButtonStop))
                .addContainerGap(143, Short.MAX_VALUE))
        );
 
        pack();
    }// </editor-fold>                        
 
    private void jButtonStartActionPerformed(java.awt.event.ActionEvent evt) {                                             
        // TODO add your handling code here:  
 
        TestFTP test = new TestFTP();
        test.Connexion("127.0.0.1");
 
        try {
            AudioPlayer audioPlayer = new AudioPlayer("file:/C:/Documents and Settings/GRESLON Jérémy/Mes documents/Photos_telechargees/Windows XP Démarrage.wav");
 
            audioPlayer.start();                                            
        } catch (Exception ex) {
            Logger.getLogger(AudioPlayer.class.getName()).log(Level.SEVERE, null, ex);
        }
    }                                            
 
    private void jButtonStopActionPerformed(java.awt.event.ActionEvent evt) {                                            
        // TODO add your handling code here:
        AudioPlayer audioPlayer = new AudioPlayer("file:/C:/Documents and Settings/GRESLON Jérémy/Mes documents/Photos_telechargees/Windows XP Démarrage.wav");
        audioPlayer.stop();
        System.exit(0);
    }                                           
 
    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        java.awt.EventQueue.invokeLater(new Runnable() {
            public void run() {
                new AudioPlayer().setVisible(true);
            }
        });
    }
 
    // Variables declaration - do not modify                     
    private javax.swing.JButton jButtonStart;
    private javax.swing.JButton jButtonStop;
    // End of variables declaration                   
 
}