play a wav file with it's content in a variable

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • Michal Wieteska
    New Member
    • Oct 2010
    • 2

    play a wav file with it's content in a variable

    I hope I did not put it in the wrong section ;-)
    I have a project where I need to read file content into a variable, for security reasons saving the file is not to be available as a standard option/action. What I have is whatever is inside the file in a variable now i need to play it as a wav file.

    Code:
    <?php 
    $filecontent=shell_exec("cat test.wav"); 
    ?>
    now I need to put whatever is in the $filecontent variable to be played on my website. I'm a very newbie to this so any help/hints are very welcome.
    Thanks :)
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Why not just use file_get_conten ts()?

    Comment

    • Thew
      New Member
      • Aug 2010
      • 69

      #3
      why dont use <embed src="file.wav"/> ?

      Comment

      • Michal Wieteska
        New Member
        • Oct 2010
        • 2

        #4
        right. I skipped some details.
        I have a gpg encrypted file in a remote location, for security reasons I am not allowed to save the file in a decrypted form but i still need to play it. what I do now is I get the file for gpg to decrypt and then put it into a variable like this
        Code:
        $filecontent=shell_exec("gpg --options-that-make-it-work -decrypt file-adress-and-name.wav.gpg");
        wich brings me the file content (just as cat would) into my preciouss variable.

        Comment

        Working...