Jump to content

pedroas

New Members
  • Posts

    5
  • Joined

  • Last visited

    Never

Posts posted by pedroas

  1. Well, there are a lot of things that could get wrong:

    1) First, when we use fopen with binary files we should do this way
    $handle = fopen("file", "rb"); 
    or
    $handle = fopen("file", "wb"); 
    to make sure file will be treated like a binary file, else it will be treated like a text file where it could do text transformations on line terminators;

    2) What is the type of audio field in MySQL?

    Pedro A. S
  2. Well, at a first sight you could put sox.exe in any directory, I suggest C:\WINDOWS (XP) or C:\WINNT (NT or 2000), but check before in PHP.INI wheater you're using safe_mode=true or 1, this directory should be inside safe_mode_exec_dir. Don't forget to call shell_exec with full pathname like shell_exec("c:/windows/sox $file1 $file2 $finalfile");
  3. I've never tried this, but there is a little program SoX at http://sox.sourceforge.net/ that you can use to concat sound fils

    .... you fetch first audio then write to a file
    $file1 = "/tmp/audio1.wma";  // maybe is better generate a random name for the file
    $descriptor = fopen ($file1, "w"); 
    fwrite($descriptor,$audio);
    fclose($descriptor);

    .... you fetch second audio then write to another file
    $file2 = "/tmp/audio2.wma";
    $descriptor2 = fopen ($file2, "w");
    fwrite($descriptor2,$audio);
    fclose($descriptor2);

    .... then you concat audio files with sox
    $finalfile = "/tmp/final.wma";
    $cmd = "sox $file1 $file2 $finalfile";
    shell_exec($cmd);

    ... erase temporary files
    unlink($file1);
    unlink($file2);

    ... the last task is to open final.wma, read and return to client
    $descriptor3 = fopen($finalfile,"r");
    $audio = fread ($descriptor3, filesize ($finalfile));
    fclose($descriptor3)

    echo $audio

    A better solution would be put $finalfile in a directory under your document root in webserver and redirect header to it.
  4. Hi folks...

    I have a page with a form like this
    [code]
    <pre>
    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
    <html>
    <head>
    <title>Page Title</title>
    <meta http-equiv="content-type" content="text/html; charset=ISO-8859-1" />
    </title>
    <body>
       <form name="frm155" action="nextpage.php" method="post" enctype="multipart/form-data">
        <label for="id1">Name</label><input type="text" id="id1" name="si_name" value="" />
        <label for="id2">Telephone</label><input type="text" id="id2" name="si_phone" value="" />
        <label for="id3">Date</label><input type="text" id="id3" name="si_fone" value="" />
        <label for="id4">Message</label><textarea id="id4" name="si_message" rows="5" cols="80"></textarea>
        <!-- possibly I could have some file upload -->
       <input type="submit" />
       </form>
    </body>
    </pre>
    [/code]
    It works fine except when some users cut and paste from MS-Word, or any other aplication with some special caracter like a bullet or a dash. In nextpage.php in $_REQUEST I get all variables but without 'si_name'. Always the first variable disapears. This only happens in IE, in FF it's ok. I'm using IE 6 in Windows, Apache 2.2 e php 4.4.2 in a Linux environment.

    tks in advance..

    Pedro A.
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.