def METHOD_NAME(self):
    """Returns the current peak and rms value (measured with the gst level element)"""
    self._prepare()
    Gst = self._Gst
    GLib = self._GLib
    src = self.create_gst_src()
    pipe = Gst.Pipeline.new('dynamic')
    level = Gst.ElementFactory.make('level')
    sink = Gst.ElementFactory.make('fakesink')
    pipe.add(src, level, sink)
    src.link(level)
    level.link(sink)
    loop = GLib.MainLoop()
    stats = {}
    def bus_call(bus, message, loop):
        t = message.type
        if t == Gst.MessageType.EOS:
            self.logger.info("End-of-stream")
            loop.quit()
        elif t == Gst.MessageType.ERROR:
            err, debug = message.parse_error()
            self.logger.error("Error: %s: %s", err, debug)
            loop.quit()
        elif t == Gst.MessageType.ELEMENT:
            self.logger.debug('peak %s', message.get_structure()['peak'])
            self.logger.debug('rms %s', message.get_structure()['rms'])
            stats.update(dict(message.get_structure()))
            loop.quit()
        else:
            self.logger.debug('gst message %s', t)
        return True
    bus = pipe.get_bus()
    bus.add_signal_watch()
    bus.connect("message", bus_call, loop)
    def timeout(*args):
        self.logger.error("loop timed out")
        stats['timeout'] = True
        loop.quit()
    GLib.timeout_add_seconds(15, timeout, None)
    # start play back and listen to events
    pipe.set_state(Gst.State.PLAYING)
    try:
        loop.run()
    finally:
        pipe.set_state(Gst.State.NULL)
    if stats.get('timeout'):
        raise TimeoutError("no data received before timeout")
    return stats