code: ITag createFileMeta() {
          log.debug("Creating onMetaData");
          // Create tag for onMetaData event
          IoBuffer buf = IoBuffer.allocate(1024);
          buf.setAutoExpand(true);
          Output out = new Output(buf);
          out.writeString("onMetaData");
          Map<Object, Object> props = new HashMap<Object, Object>();
          // Duration property
          props.put("duration", ((double) duration / (double) timeScale));
  
          // Audio codec id - watch for mp3 instead of aac
          props.put("audiocodecid", audioCodecId);
          props.put("aacaot", audioCodecType);
          props.put("audiosamplerate", audioTimeScale);
          props.put("audiochannels", audioChannels);
          props.put("canSeekToEnd", false);
          out.writeMap(props);
          buf.flip();
  
          //now that all the meta properties are done, update the duration
          duration = Math.round(duration * 1000d);
  
          ITag result = new Tag(IoConstants.TYPE_METADATA, 0, buf.limit(), null, 0);
          result.setBody(buf);
          return result;
      }
docs: Create tag for metadata event.
  
  @return Metadata event tag