Merci de ton aide, mais en le lisant, j'ai peur que ça ne marchera pas :
- tu initialises la variable line au début en faisant
line = AudioSystem.getLine(Port.Info.MICROPHONE)
- et plus tard
line = (TargetDataLine) AudioSystem.getLine(info);
Je vais essayer de revoir la doc de chez sun

Envoyé par
ypicman
Bah pourtant c'est bien documenté chez sun... Mais effectivement, toi tu prends le canal de sortie de ton systeme... voici la philosophie:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
|
TargetDataLine line;
if (AudioSystem.isLineSupported(Port.Info.MICROPHONE)) {
try {
line = (Port) AudioSystem.getLine(
Port.Info.MICROPHONE);
}
}
DataLine.Info info = new DataLine.Info(TargetDataLine.class,
format); // format is an AudioFormat object
if (!AudioSystem.isLineSupported(info)) {
// Handle the error.
}
// Obtain and open the line.
try {
line = (TargetDataLine) AudioSystem.getLine(info);
line.open(format);
} catch (LineUnavailableException ex) {
// Handle the error.
//...
} |
Partager