summaryrefslogtreecommitdiff
path: root/lib/sounds.php
diff options
context:
space:
mode:
authorilotterytea <iltsu@alright.party>2025-10-25 20:12:11 +0500
committerilotterytea <iltsu@alright.party>2025-10-25 20:12:11 +0500
commit6e731c328aa66d61d882dc73080175f352d82ebc (patch)
tree9f100129406aa0d29397493c2b2df3ec92b69315 /lib/sounds.php
parent2dfa25d9ac9358d2bade1f164d5650bded678de7 (diff)
feat: sound upload
Diffstat (limited to 'lib/sounds.php')
-rw-r--r--lib/sounds.php12
1 files changed, 12 insertions, 0 deletions
diff --git a/lib/sounds.php b/lib/sounds.php
new file mode 100644
index 0000000..23f566f
--- /dev/null
+++ b/lib/sounds.php
@@ -0,0 +1,12 @@
+<?php
+function compress_sound(string $input_file, string $output_file)
+{
+ if (!is_file($input_file)) {
+ throw new RuntimeException("Sound input file does not exist.");
+ }
+
+ $input_file = escapeshellarg($input_file);
+ $output_file = escapeshellarg($output_file);
+
+ shell_exec("ffmpeg -i $input_file -c:a libvorbis -q:a 1 $output_file");
+} \ No newline at end of file