Dragonfly
Dragonfly

Reputation: 4361

PHP exec not giving the same result as cmd

exec ("C:/Lame/sox \"C:/1/2.wav\" -t wav \"C:/1/2.rev\" reverse");

Using that code to use an audio post processing tool to reverse a sound file. There is an output but the file is about 1/5th the size it should be and I am unable to play it. Basically it makes a file but its not the one I would have gotten if I did this in the command prompt:

C:/Lame/sox "C:/1/2.wav" -t wav "C:/1/2.rev" reverse

With that, I get the result I want and I am able to play the rev file.

Anyone have any idea why this is happening?

Upvotes: 2

Views: 227

Answers (1)

Dragonfly
Dragonfly

Reputation: 4361

Found the problem. It was a permission problem.

All the other post processing command works because it writes in that folder. Reverse makes a temporary file in another folder which the current user didn't have write access in which why it made a small file since it tried to later read from a file that didn't exist.

Upvotes: 1

Related Questions