1
我在java的JMF以下主要課,我需要提高的音頻文件test.wav IM的播放嘗試setRate instuction,但它不工作:我如何改變音頻文件播放的速度?
這裏是主類:
import javax.swing.*;
import java.awt.*;
import javax.media.*;
import java.awt.event.*;
import java.net.*;
public class HelloJMF
{
static JFrame frame = new JFrame(" Hello JMF Player");
static Player helloJMFPlayer = null;
public static void main(String args[])
{
try
{
URL url=new URL("file:///d:\\testJMF.wav");
helloJMFPlayer = Manager.createRealizedPlayer(url);
}
catch(Exception e)
{
System.out.println(" Unable to create the audioPlayer :" + e);
}
Component control = helloJMFPlayer.getControlPanelComponent();
frame.getContentPane().add(control, BorderLayout.CENTER);
frame.addWindowListener(new WindowAdapter()
{
public void windowClosing(WindowEvent we)
{
helloJMFPlayer.stop();
helloJMFPlayer.close();
System.exit(0);
}
});
frame.setSize(new Dimension(400,100));
frame.setVisible(true);
helloJMFPlayer.start();
}
}
我需要改變打球的速度,我想:
helloJMFPlayer.setRate(3);
,但它不能正常工作,我需要你的幫助,請。
哪個值不helloJMFPlayer.setRate(3)返回? – Berger