From 893f21b8c6cf236fca12be2382cac87c6219c40a Mon Sep 17 00:00:00 2001 From: Tykayn Date: Thu, 16 Feb 2023 14:49:46 +0100 Subject: [PATCH] php analyse de transcript audio --- php/conversion timestamp secondes/convert.php | 233 +++++++++++++++++- php/conversion timestamp secondes/uniq.php | 179 ++++++++++++++ 2 files changed, 407 insertions(+), 5 deletions(-) create mode 100644 php/conversion timestamp secondes/uniq.php diff --git a/php/conversion timestamp secondes/convert.php b/php/conversion timestamp secondes/convert.php index de4c6f0a..d8d18475 100644 --- a/php/conversion timestamp secondes/convert.php +++ b/php/conversion timestamp secondes/convert.php @@ -175,24 +175,246 @@ $data = [" 00:02:07.000 " ]; +// 2023-02-02 +$data = ['00:06:31.000 +00:04:48.639 +00:02:21.000 +00:01:13.000 +00:03:43.000 +00:13:41.000 +00:01:21.000 +00:04:39.000 +00:01:16.000 +00:03:39.000 +00:03:58.000 +00:00:49.000 +00:08:27.000 +00:04:10.000 +']; -$data = explode("\n" , $data[0]); +// intervenants selon Le Bétonnier +$data = ['00:08:24.000 +00:09:16.000 +00:07:07.000 +00:04:32.000 +00:03:05.000 +00:07:23.000 +00:10:47.000 +00:12:11.000 +00:06:36.000 +00:16:13.000 +00:10:45.000 +00:00:43.000 +00:20:18.000 +00:18:42.000 +00:10:18.000 +00:01:32.000 +00:15:34.000 +00:04:02.000 +00:01:52.000 +00:01:11.000 +00:01:31.000 +00:04:03.000 +00:04:27.000 +00:05:32.000 +00:00:51.000 +00:04:01.000 +00:02:40.000 +00:03:15.000 +00:01:09.000 +00:04:21.000 +00:01:31.000 +00:02:25.000 +00:06:47.000 +00:04:25.000 +00:04:36.000 +00:01:16.000 +00:07:14.000 +00:04:08.000 +00:03:03.000 +00:02:15.000 +00:04:50.000 +00:02:28.000 +00:03:58.000 +00:07:51.000 +00:06:29.000 +00:10:02.000 +00:03:46.000 +00:11:29.000 +00:07:27.000 +00:26:03.000 +00:09:09.000 +00:17:43.000 +00:15:08.000 +00:12:21.000 +00:15:29.000 +00:02:48.000 +00:02:12.000 +00:15:12.000 +00:19:19.000 +00:06:31.000 +00:02:21.000 +00:01:13.000 +00:01:21.000 +00:04:39.000 +00:01:16.000 +00:03:39.000 +00:03:58.000 +00:00:49.000 +00:08:27.000 +00:04:10.000 +00:02:48.000 +00:02:10.000 +00:02:08.000 +00:00:31.000 +00:02:05.000 +00:00:55.000 +00:02:11.000 +00:02:16.000 +00:02:19.000 +00:02:02.000 +00:02:19.000 +00:02:57.000 +00:02:38.000 +00:02:45.000 +00:01:25.000 +00:02:11.000 +00:01:56.000 +00:02:56.000 +00:02:01.000 +00:01:58.000 +00:01:33.000 +00:00:53.000 +00:01:33.000 +00:01:22.000 +00:00:56.000 +00:01:47.000 +00:01:57.000 +00:01:09.000 +00:01:07.000 +00:00:09.000 +00:06:29.555 +00:02:18.000 +00:01:38.000 +00:01:52.000 +00:01:36.000 +00:00:31.000 +00:00:49.000 +00:00:45.000 +00:00:23.000 +00:01:49.000 +00:02:05.000 +00:02:36.000 +00:01:00.000 +00:03:24.000 +00:01:15.000 +00:00:56.000 +00:01:58.000 +00:02:24.000 +00:01:30.000 +00:01:24.000 +00:01:01.000 +00:02:06.000 +00:00:57.000 +00:02:05.000 +00:00:41.000 +00:02:03.000 +00:00:05.000 +00:03:33.000 +00:01:05.000 +00:02:34.000 +00:02:08.000 +00:00:43.000 +00:01:23.000 +00:02:20.000 +00:02:09.000 +00:00:14.000 +00:02:38.000 +00:00:15.000 +00:02:47.000 +00:02:42.000 +00:03:37.000 +00:02:07.000 +00:01:26.000 +00:00:24.000 +00:04:35.000 +00:00:57.000 +00:01:31.000 +00:03:21.000 +00:01:37.000 +00:00:31.000 +00:02:32.000 +00:02:32.000 +00:05:36.000 +00:03:55.000 +00:01:33.000 +00:01:34.000 +00:02:23.000 +00:02:06.000 +00:02:03.000 +00:02:41.000 +00:02:10.000 +00:02:04.000 +00:01:22.000 +00:13:08.000 +00:22:08.000 +00:00:59.000 +00:15:02.000 +00:13:35.000 +00:13:20.000 +00:17:34.000 +00:13:34.000 +00:01:53.000 +00:01:57.000 +00:16:17.000 +00:02:08.000 +00:04:48.000 +00:16:00.000 +00:00:14.000 +00:00:51.000 +00:02:06.000 +00:01:19.000 +00:03:36.000 +00:01:30.000 +00:06:00.000 +00:01:53.000 +00:07:00.000 +00:02:05.000 +00:02:41.000 +00:00:51.000 +00:03:33.000 +00:00:48.000 +00:01:53.000 +00:01:51.275 +00:02:11.000 +00:01:15.000 +00:08:53.000 +00:14:55.000 +00:02:08.000 +00:01:20.000 +00:13:41.000 +']; -var_dump($data); +$data = explode("\n", $data[0]); + +//var_dump($data); $results = []; foreach ($data as $datum) { - if($datum){ + if ($datum) { - $results[] = convertTimeStampToSeconds($datum); + $results[] = convertTimeStampToSeconds($datum); } } function convertTimeStampToSeconds($timestamp) { +// if (!$timestamp) { +// return ' ' +// } $converted = ''; $boom = explode(':', $timestamp); $seconds = explode('.', $boom[2]); @@ -200,7 +422,8 @@ function convertTimeStampToSeconds($timestamp) return $converted; } +echo "\n"; foreach ($results as $result) { - echo "\n" . $result . ' '; + echo round($result) . "\n"; } \ No newline at end of file diff --git a/php/conversion timestamp secondes/uniq.php b/php/conversion timestamp secondes/uniq.php new file mode 100644 index 00000000..5a7ed9f2 --- /dev/null +++ b/php/conversion timestamp secondes/uniq.php @@ -0,0 +1,179 @@ +