OK, I've been banging my head against a wall here for several hours and can't seem to find a solution. Basically, I need to run a system command through PHP (I've tested using exec, system, passthru, etc.) and store the output to a variable. I'm running a sox command to get the stats of a sound file which returns output like the following:
Samples read: 27600
Length (seconds): 3.450000
Scaled by: 2147483647.0
Maximum amplitude: 0.171753
Minimum amplitude: -0.171753
Midline amplitude: 0.000000
Mean norm: 0.003991
Mean amplitude: -0.000039
RMS amplitude: 0.013365
Maximum delta: 0.175537
Minimum delta: 0.000000
Mean delta: 0.002996
RMS delta: 0.009204
Rough frequency: 876
Volume adjustment: 5.822
I need all of this output trapped in a variable so I can parse the length, but none of these functions seem to do this. I've read all the documentation and even the comments. Any insight on how to accomplish this would be tremendously appreciated!!