public function getRandomNoiseFile()
    {
        $return = false;

        if ( ($dh = opendir($this->audio_noise_path)) !== false ) {
            $list = array();

            while ( ($file = readdir($dh)) !== false ) {
                if ($file == '.' || $file == '..') continue;
                if (strtolower(substr($file, -4)) != '.wav') continue;

                $list[] = $file;
            }

            closedir($dh);

            if (sizeof($list) > 0) {
                $file   = $list[array_rand($list, 1)];
                $return = $this->audio_noise_path . DIRECTORY_SEPARATOR . $file;

                if (!is_readable($return)) $return = false;
            }
        }

        return $return;
    }
public function getRandomNoiseFile()
    {
        $return = false;

        if ( ($dh = opendir($this->audio_noise_path)) !== false ) {
            $list = array();

            while ( ($file = readdir($dh)) !== false ) {
                if ($file == '.' || $file == '..') continue;
                if (strtolower(substr($file, -4)) != '.wav') continue;

                $list[] = $file;
            }

            closedir($dh);

            if (sizeof($list) > 0) {
                $file   = $list[array_rand($list, 1)];
                $return = $this->audio_noise_path . DIRECTORY_SEPARATOR . $file;

                if (!is_readable($return)) $return = false;
            }
        }

        return $return;
    }
public function getRandomNoiseFile ( ) { $ return = false ; if ( ( $ dh = opendir ( $ this -> audio_noise_path ) ) !== false ) { $ list = array ( ) ; while ( ( $ file = readdir ( $ dh ) ) !== false ) { if ( $ file == '.' || $ file == '..' ) continue ; if ( strtolower ( substr ( $ file , - 4 ) ) != '.wav' ) continue ; $ list [ ] = $ file ; } closedir ( $ dh ) ; if ( sizeof ( $ list ) > 0 ) { $ file = $ list [ array_rand ( $ list , 1 ) ] ; $ return = $ this -> audio_noise_path . DIRECTORY_SEPARATOR . $ file ; if ( ! is_readable ( $ return ) ) $ return = false ; } } return $ return ; }
Gets and returns the path to a random noise file from the audio noise directory.

@return bool|string  false if a file could not be found, or a string containing the path to the file.
Gets and returns the path to a random noise file from the audio noise directory .