Wie kann man eine Datei (in meinem Fall MP3) vergrößern, ohne dass der Inhalt sich ändert?

4 Antworten

einfach ein download script nehmen was eine pause drinne hat beim ausliefern der KB daten . Im Beispiel "KB pro sekunde"

ggf , die script ausführungs maximalzeit in der php config hoch setzen .

online beispiel

https://praetorians.000webhostapp.com/sweet/

z.b.

<?php
if (isset($_POST['download'])) {
       if ($_POST['download'] == "was im password feld stehen muss um") {
      $oldname = "diese_datei_auszuliefernder_name.pdf";
      $name ="mit_dieser_datei_lokal_gespeichert_auf_dem_server.pdf";

      $fd = fopen($name, 'rb');

      if($fd == false)      die("<font color=red>ERROR: File not found.</font>");  
      // send the right headers
      header("Cache-Control: ");// leave blank to avoid IE errors
      header("Pragma: ");// leave blank to avoid IE errors
      header("Content-type: application/octet-stream");
      header("Content-Disposition: attachment; filename=\"" . $oldname . "\"");
      header("Content-length:".(string)(filesize($name)));
      sleep(1);
      ob_flush();
      flush();
      while(!feof($fd)) {
        $buffer = fread($fd, 2048); // 2KB pro Sekunde .
        print $buffer;
        sleep(1); // warte 1 sekunde auf die nächsten 2KB
      }
      fclose ($fd);

      } else {
      header("Content-Type: text/html; charset=utf-8");
      ?><!DOCTYPE html>
<html>
      <head>
      <style type="text/css">
      /* <![CDATA[ */
      html {width:100%; height:100%;}
         body { background-color:#C0BFAD;
         height:100%; 
         width:800px;
                  position: absolute;
                  top: 10px;
                  left: 50%;
                  margin-top: 0px;
                  margin-left: -400px;
         }
         fieldset {
         overflow:hidden;
         background:#FFF8DC;
         border:0px;
         padding:0 20px 20px 20px;
         -moz-border-radius:15px;
         -webkit-border-radius:15px;
         }
input[type=text], input[type=password], input[type=submit] {
   color:#666;
   border:1px solid #d8d8d8;
   float:left;
   -moz-border-radius:9px;
   -webkit-border-radius:9px;
   background: url('system/img/gradient_white.png') repeat-x top left #efefef;
   padding:3px 10px;
   margin-top:10px;
}
.send {
   background: url('system/img/gradient_black.png') repeat-x top left #a80329;
   -moz-border-radius:15px;
   -webkit-border-radius:15px;
   -moz-box-shadow: 5px 5px 8px #999;
   -webkit-box-shadow: 5px 5px 8px #999;
   border:0;
   cursor:pointer;
   color:#fff;
   font-weight:bold;
   font-size:90%;
   padding:5px 15px;
   margin-top:10px;
}
#sender {width:800px; height:100px;}
label {display:block; float:left; margin-top:10px;}   
/* ]]> */   
      </style>
      </head>
<body>
<div style="width:800px; height:470px;">
<img src="rutschbahn_vogel.jpg" />
<form id="sender" name="sender" method="post" action="?">
<fieldset>
<legend></legend>
<label for="download">Passwort:</label><input name="download" id="download" type="text" style="width:350px; background-color:#FFF000" value="keine Datei für dieses Passwort vorhanden" />
<button style="float:right;" class="send" type="submit" name="sendbtn" id="sendbtn" >downloaden</button>
</fieldset>
</form>
</div>
</body>
</html>
      <?php
      }
} else {
header("Content-Type: text/html; charset=utf-8");
?><!DOCTYPE html>
<html>
      <head>
      <style type="text/css">
      /* <![CDATA[ */
      html {width:100%; height:100%;}
         body { background-color:#C0BFAD;
         height:100%; 
         width:800px;
                  position: absolute;
                  top: 10px;
                  left: 50%;
                  margin-top: 0px;
                  margin-left: -400px;
         }
         fieldset {
         overflow:hidden;
         background:#FFF8DC;
         border:0px;
         padding:0 20px 20px 20px;
         -moz-border-radius:15px;
         -webkit-border-radius:15px;
         }
input[type=text], input[type=password], input[type=submit] {
   color:#666;
   border:1px solid #d8d8d8;
   float:left;
   -moz-border-radius:9px;
   -webkit-border-radius:9px;
   background: url('system/img/gradient_white.png') repeat-x top left #efefef;
   padding:3px 10px;
   margin-top:10px;
}
.send {
   background: url('system/img/gradient_black.png') repeat-x top left #a80329;
   -moz-border-radius:15px;
   -webkit-border-radius:15px;
   -moz-box-shadow: 5px 5px 8px #999;
   -webkit-box-shadow: 5px 5px 8px #999;
   border:0;
   cursor:pointer;
   color:#fff;
   font-weight:bold;
   font-size:90%;
   padding:5px 15px;
   margin-top:10px;
}
#sender {width:800px; height:100px;}
label {display:block; float:left; margin-top:10px;}   
/* ]]> */   
      </style>
      </head>
<body>
<div style="width:800px; height:470px;">
<img src="rutschbahn_vogel.jpg" />
<form id="sender" name="sender" method="post" action="?">
<fieldset>
<legend></legend>
<label for="download">Passwort:</label><input name="download" id="download" type="text" style="width:350px;" />
<button style="float:right;" class="send" type="submit" name="sendbtn" id="sendbtn" >downloaden</button>
</fieldset>
</form>
</div>
</body>
</html>
<?php
}
?>

Das ist möglich, indem man in die Datenstruktur einer MP3-Datei eingreift und sogenannte Tags einfügt, die keine Audioinformation enthalten. Um das zu bewerkstelligen, sind jedoch weitgehende Programmierkenntnisse nötig.

Für einen Laien gäbe es die Möglichkeit, mit einem Audioeditor am Ende des Stücks Stille einzufügen. Ich habe das mal ausprobiert. Zwei Stunden Stille benötigen ca. 80 Megabytes. Der Nachteil an dieser Lösung ist leider, dass die Länge des Stücks dann nicht mehr mit dem Original übereinstimmt. Will man das umgehen, bleibt nur die erste Möglichkeit.


StefanAumueller  21.05.2021, 09:24

Er könnte das Stück auch zig mal hintereinander kopieren. Wäre auch eine Möglichkeit.

1

Ich verstehe den Sinn dahinter nicht. Aber gut. Man kann die Datei vergrößern aber nicht so, dass sie extrem lange braucht um Herunterzuladen.

Woher ich das weiß:Hobby

Einfach mit der höchsten Bitrate exportieren, dann wird die Datei schön gross. Sehe da zwar kein Sinm aber ja ich hoffe dass dir das helfen wird xD

Woher ich das weiß:Hobby

Mediachaos  21.05.2021, 07:29

Das verändert zwar die Dateigröße, aber die Downloadzeit bleibt bei ordentlicher Datenrate im Sekundenbereich.

0