diff --git a/tests/examples/level/level-example.c b/tests/examples/level/level-example.c
index a953176..52a8d5f 100644
--- a/tests/examples/level/level-example.c
+++ b/tests/examples/level/level-example.c
@@ -86,24 +86,56 @@ message_handler (GstBus * bus, GstMessage * message, gpointer data)
   return TRUE;
 }
 
+static void
+pad_added_cb (GstElement * element, GstPad * pad, GstElement *audioconvert)
+{
+  GstPad *otherpad;
+  GstCaps *caps;
+  GstStructure *s;
+
+  caps = gst_pad_get_current_caps (pad);
+  s = gst_caps_get_structure (caps, 0);
+  if (!gst_structure_has_name (s, "audio/x-raw")) {
+    gst_caps_unref (caps);
+    return;
+  }
+  gst_caps_unref (caps);
+
+  otherpad = gst_element_get_static_pad (audioconvert, "sink");
+  if (!gst_pad_is_linked (otherpad)) {
+    GstPadLinkReturn ret = gst_pad_link (pad, otherpad);
+    g_assert (ret == GST_PAD_LINK_OK);
+  }
+
+  gst_object_unref (otherpad);
+}
+
 int
 main (int argc, char *argv[])
 {
-  GstElement *audiotestsrc, *audioconvert, *level, *fakesink;
+  GstElement *src, *audioconvert, *level, *fakesink;
   GstElement *pipeline;
   GstCaps *caps;
   GstBus *bus;
   guint watch_id;
   GMainLoop *loop;
+  gchar *uri;
 
   gst_init (&argc, &argv);
 
-  caps = gst_caps_from_string ("audio/x-raw,channels=2");
+  g_assert (argc == 2 && argv[1] != NULL && *argv[1] != '\0');
+  if (gst_uri_is_valid (argv[1]))
+    uri = g_strdup (argv[1]);
+  else
+    uri = gst_filename_to_uri (argv[1], NULL);
+  g_assert (uri != NULL);
+
+  caps = gst_caps_from_string ("audio/x-raw,channels=1");
 
   pipeline = gst_pipeline_new (NULL);
   g_assert (pipeline);
-  audiotestsrc = gst_element_factory_make ("audiotestsrc", NULL);
-  g_assert (audiotestsrc);
+  src = gst_element_factory_make ("uridecodebin", NULL);
+  g_assert (src);
   audioconvert = gst_element_factory_make ("audioconvert", NULL);
   g_assert (audioconvert);
   level = gst_element_factory_make ("level", NULL);
@@ -111,15 +143,15 @@ main (int argc, char *argv[])
   fakesink = gst_element_factory_make ("fakesink", NULL);
   g_assert (fakesink);
 
-  gst_bin_add_many (GST_BIN (pipeline), audiotestsrc, audioconvert, level,
+  gst_bin_add_many (GST_BIN (pipeline), src, audioconvert, level,
       fakesink, NULL);
-  if (!gst_element_link (audiotestsrc, audioconvert))
-    g_error ("Failed to link audiotestsrc and audioconvert");
+  g_signal_connect (src, "pad-added", G_CALLBACK (pad_added_cb), audioconvert);
   if (!gst_element_link_filtered (audioconvert, level, caps))
     g_error ("Failed to link audioconvert and level");
   if (!gst_element_link (level, fakesink))
     g_error ("Failed to link level and fakesink");
 
+  g_object_set (G_OBJECT (src), "uri", uri, NULL);
   /* make sure we'll get messages */
   g_object_set (G_OBJECT (level), "post-messages", TRUE, NULL);
   /* run synced and not as fast as we can */
