System.exit(1);
}
Element src = ElementFactory.make("filesrc", "Input File");
src.set("location", args[0]);
DecodeBin2 decodeBin = new DecodeBin2("Decode Bin");
pipe = new Pipeline("main pipeline");
Element decodeQueue = ElementFactory.make("queue", "Decode Queue");
pipe.addMany(src, decodeQueue, decodeBin);
Element.linkMany(src, decodeQueue, decodeBin);
/* create audio output */
final Bin audioBin = new Bin("Audio Bin");
Element conv = ElementFactory.make("audioconvert", "Audio Convert");
Element resample = ElementFactory.make("audioresample", "Audio Resample");
Element sink = ElementFactory.make("autoaudiosink", "sink");
audioBin.addMany(conv, resample, sink);
Element.linkMany(conv, resample, sink);
audioBin.addPad(new GhostPad("sink", conv.getStaticPad("sink")));
pipe.add(audioBin);
decodeBin.connect(new DecodeBin2.NEW_DECODED_PAD() {
public void newDecodedPad(DecodeBin2 elem, Pad pad, boolean last) {
/* only link once */
if (pad.isLinked()) {
return;