title: Qt Serialize audio files and MIME data
body: <p>I'm trying to load audio files in my software and be able to create a save file containing the software data with the loaded audio bundled with it (serialized with <code>QDataStream</code>).</p>
  
  <p>My first idea was to store the data into a <code>QByteArray</code> and later open it with <code>QBuffer</code> and play on a <code>QMediaPlayer</code> as a <code>QIODevice</code>, but as the documentation says:</p>
  
  <blockquote>
    <p>If a stream is supplied; media data will be read from it instead of
    resolving the media source. In this case the media source may still be
    used to resolve additional information about the media such as mime
    type. The stream must be open and readable.</p>
  </blockquote>
  
  <p>The loaded audio may have different kinds of codecs and bitrates, so it would be needed to store this info in a container, as a <code>QMediaResource</code> or <code>QMediaContent</code> does, but both containers are not serializable.</p>
  
  <p>My other idea was to open a <code>QByteArray</code> with a <code>QFile</code>, but it doesent seem possible.</p>
  
  <p>So, the question is</p>
  
  <blockquote>
    <p>How can an audio file be loaded, serialized and played on a
    QMediaPlayer correctly?</p>
  </blockquote>
  
  <p>Thanks.</p>