File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -43,26 +43,26 @@ public function getInfo()
4343 $ ret = null ;
4444 exec ('sox --i ' . escapeshellarg ($ this ->filename ) . ' 2>&1 ' , $ out , $ ret );
4545 $ str = implode ('| ' , $ out );
46-
46+
4747 $ match = null ;
4848 if (preg_match ('/Channels?\s*\:\s*(\d+)/ui ' , $ str , $ match )) {
4949 $ this ->channels = intval ($ match [1 ]);
5050 }
51-
51+
5252 $ match = null ;
5353 if (preg_match ('/Sample\s*Rate\s*\:\s*(\d+)/ui ' , $ str , $ match )) {
5454 $ this ->sampleRate = intval ($ match [1 ]);
5555 }
56-
56+
5757 $ match = null ;
5858 if (preg_match ('/Duration.*[^\d](\d+)\s*samples?/ui ' , $ str , $ match )) {
5959 $ this ->samples = intval ($ match [1 ]);
6060 }
61-
61+
6262 if ($ this ->samples && $ this ->sampleRate ) {
6363 $ this ->duration = 1.0 * $ this ->samples / $ this ->sampleRate ;
6464 }
65-
65+
6666 if ($ ret !== 0 ) {
6767 throw new \Exception ('Failed to get audio info. ' . PHP_EOL . 'Error: ' . implode (PHP_EOL , $ out ) . PHP_EOL );
6868 }
You can’t perform that action at this time.
0 commit comments