protected function getSoxNoiseData($duration, $numChannels, $sampleRate, $bitRate)
    {
        $shapes = array('sine', 'square', 'triangle', 'sawtooth', 'trapezium');
        $steps  = array(':', '+', '/', '-');
        $selShapes = array_rand($shapes, 2);
        $selSteps  = array_rand($steps, 2);
        $sweep0    = array();
        $sweep0[0] = mt_rand(100, 700);
        $sweep0[1] = mt_rand(1500, 2500);
        $sweep1    = array();
        $sweep1[0] = mt_rand(500, 1000);
        $sweep1[1] = mt_rand(1200, 2000);

        if (mt_rand(0, 10) % 2 == 0)
            $sweep0 = array_reverse($sweep0);

        if (mt_rand(0, 10) % 2 == 0)
            $sweep1 = array_reverse($sweep1);

        $cmd = sprintf("%s -c %d -r %d -b %d -n -t wav - synth noise create vol 0.3 synth %.2f %s mix %d%s%d vol 0.3 synth %.2f %s fmod %d%s%d vol 0.3",
                       $this->sox_binary_path,
                       $numChannels,
                       $sampleRate,
                       $bitRate,
                       $duration,
                       $shapes[$selShapes[0]],
                       $sweep0[0],
                       $steps[$selSteps[0]],
                       $sweep0[1],
                       $duration,
                       $shapes[$selShapes[1]],
                       $sweep1[0],
                       $steps[$selSteps[1]],
                       $sweep1[1]
                       );
        $data = `$cmd`;

        return $data;
    }
protected function getSoxNoiseData($duration, $numChannels, $sampleRate, $bitRate)
    {
        $shapes = array('sine', 'square', 'triangle', 'sawtooth', 'trapezium');
        $steps  = array(':', '+', '/', '-');
        $selShapes = array_rand($shapes, 2);
        $selSteps  = array_rand($steps, 2);
        $sweep0    = array();
        $sweep0[0] = mt_rand(100, 700);
        $sweep0[1] = mt_rand(1500, 2500);
        $sweep1    = array();
        $sweep1[0] = mt_rand(500, 1000);
        $sweep1[1] = mt_rand(1200, 2000);

        if (mt_rand(0, 10) % 2 == 0)
            $sweep0 = array_reverse($sweep0);

        if (mt_rand(0, 10) % 2 == 0)
            $sweep1 = array_reverse($sweep1);

        $cmd = sprintf("%s -c %d -r %d -b %d -n -t wav - synth noise create vol 0.3 synth %.2f %s mix %d%s%d vol 0.3 synth %.2f %s fmod %d%s%d vol 0.3",
                       $this->sox_binary_path,
                       $numChannels,
                       $sampleRate,
                       $bitRate,
                       $duration,
                       $shapes[$selShapes[0]],
                       $sweep0[0],
                       $steps[$selSteps[0]],
                       $sweep0[1],
                       $duration,
                       $shapes[$selShapes[1]],
                       $sweep1[0],
                       $steps[$selSteps[1]],
                       $sweep1[1]
                       );
        $data = `$cmd`;

        return $data;
    }
protected function getSoxNoiseData ( $ duration , $ numChannels , $ sampleRate , $ bitRate ) { $ shapes = array ( 'sine' , 'square' , 'triangle' , 'sawtooth' , 'trapezium' ) ; $ steps = array ( ':' , '+' , '/' , '-' ) ; $ selShapes = array_rand ( $ shapes , 2 ) ; $ selSteps = array_rand ( $ steps , 2 ) ; $ sweep0 = array ( ) ; $ sweep0 [ 0 ] = mt_rand ( 100 , 700 ) ; $ sweep0 [ 1 ] = mt_rand ( 1500 , 2500 ) ; $ sweep1 = array ( ) ; $ sweep1 [ 0 ] = mt_rand ( 500 , 1000 ) ; $ sweep1 [ 1 ] = mt_rand ( 1200 , 2000 ) ; if ( mt_rand ( 0 , 10 ) % 2 == 0 ) $ sweep0 = array_reverse ( $ sweep0 ) ; if ( mt_rand ( 0 , 10 ) % 2 == 0 ) $ sweep1 = array_reverse ( $ sweep1 ) ; $ cmd = sprintf ( "%s -c %d -r %d -b %d -n -t wav - synth noise create vol 0.3 synth %.2f %s mix %d%s%d vol 0.3 synth %.2f %s fmod %d%s%d vol 0.3" , $ this -> sox_binary_path , $ numChannels , $ sampleRate , $ bitRate , $ duration , $ shapes [ $ selShapes [ 0 ] ] , $ sweep0 [ 0 ] , $ steps [ $ selSteps [ 0 ] ] , $ sweep0 [ 1 ] , $ duration , $ shapes [ $ selShapes [ 1 ] ] , $ sweep1 [ 0 ] , $ steps [ $ selSteps [ 1 ] ] , $ sweep1 [ 1 ] ) ; $ data = `$cmd` ; return $ data ; }
This function is not yet used.

Generate random background noise from sweeping oscillators

@param float $duration  How long in seconds the generated sound will be
@param int $numChannels Number of channels in output wav
@param int $sampleRate  Sample rate of output wav
@param int $bitRate     Bits per sample (8, 16, 24)
@return string          Audio data in wav format
This function is not yet used .