User Tools

Site Tools


podcast_generator

Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Next revision
Previous revision
Last revision Both sides next revision
podcast_generator [2020/01/03 16:14]
neil created
podcast_generator [2020/01/03 16:41]
neil meh, have your book title emojis :P
Line 57: Line 57:
    ​die("​Missing info.json"​);​    ​die("​Missing info.json"​);​
  
-   ​header("​Content-Type:​ application/​rss+xml;​ charset=ISO-8859-1");+   ​header("​Content-Type:​ application/​rss+xml;​ charset=utf-8");
  
    $json = json_decode(file_get_contents($meta_file),​ true);    $json = json_decode(file_get_contents($meta_file),​ true);
Line 148: Line 148:
 </​code>​ </​code>​
  
 +The lengths/​duration above are just set to 32 minutes (this will be auto-updated by your client when you start to play the file). ​ You can set these automatically if you have access to the mp3info program (''​apt install mp3info''​) then replace the duration (''​00:​32:​16''​ with ''​$duration''​) and add this code around line 61, just after the $size variable is set:
 +<code php>
 +$duration = gmdate("​H:​i:​s",​ `mp3info -p "​%S"​ "​$file"​`);​
 +</​code>​
  
podcast_generator.txt ยท Last modified: 2020/01/03 16:46 by neil