I am trying to learn the exec and system function, what can i call to convert mp3 to wav using this function, I know it is for calling out side programs. Much help is appricated.

    You can use any non-interactive command line program available to you which converts mp3s to wav files.

    If you want some suggestions of programs, you might want to tell us your OS. On my machine (linux) this command works:

    mpg123 -s mysong.mp3 | sox -t raw -r 44100 -s -w -c 2 - mysong.wav

      sorry i am running on linux, is there a help file on the command you just gave me, like for 32kbs, mono.

        If it's on your system, then - like pretty much any program on a Linux box -

        man mpg123

        and

        man sox

        would give you documentation on those two programs.

        If they're not there, you're going to have to look at your system and find out what it does have.

          mpg123 just "plays" the mp3 file. The "-s" option tells it to output to standard out. sox does the real work of converting the file for you. If your version of sox supports mp3 files you wouldn't even need mpg123. ("sox -h" to see a supported format list.)

          Here is an online version of the sox man page, which tells you all the options.

          Here is an introductory article to using sox.

            5 days later

            it on my server and i dont have access to the shell, but if there was actually some documantation for teh sxec command it would be cool. But one thing can sox convert mp3 to mp4 and if so can some one show me

              I presume you meant "exec" when you wrote "sxec". Documentation for exec() won't help you. You want documenation for sox, and I understand mtmosier has already given you some of that.

                24 days later

                does anyone know any php documentation i read the above i am trying to do a trim but i am stumped

                i kow its trim 0 10 the 10 being 10 seconds pleas any documentation would be appricated

                I am doing everything via my web browser i dont have access to the server computer

                  Maybe one of the other system call functions? [man]shell_exec[/man] will capture whatever the called program sends to stdout.

                  Once again, PHP's documentation doesn't contain any documentation about sox, any more than sox's documentation contains documentation about PHP.

                    Write a Reply...