我正在尝试用Java中的Xuggler将aac/wav/wma音频文件转换为mp3.
不幸的是,我的质量大大降低.我的输入文件大小约为7MB,输出文件大小仅为1.5MB.
采样率设置为44100 Hz,是否还要设置其他参数?
谢谢您的回答.
if (args.length <= 1)
throw new IllegalArgumentException("must pass an input filename and output filename as argument");
IMediaWriter writer = ToolFactory.makeWriter(args[1]);
String filename = args[0];
// Create a Xuggler container object
IContainer container = IContainer.make();
// Open up the container
if (container.open(filename, IContainer.Type.READ, null) < 0)
throw new IllegalArgumentException("could not open file: " + filename);
// query how many streams the call to open found
int numStreams = container.getNumStreams();
// and iterate through the streams to …Run Code Online (Sandbox Code Playgroud)