воспроизведение звука в чужой сессии из командной строки

Вы можете использовать следующий (bash) скрипт, сохранить его как mergeSubtitle.sh, запустив его, набрав в терминале «bash mergeSubtitle.sh».

#!/bin/sh
# mergeSubtitle.sh: Script to merge 2 SRT subtitle into single one
# This is script is freely available under the GNU/GPL license
# Author: Antonymous X
# antonymousx@gmail.com
# 07/19/2015

test "$#" -ne 3  && echo -e "Usage: 2subs \"<LANGUAGE_FILE_1>\" \"<LANGUAGE_FILE_2>\" \"<COMBINED_LANGUAGE_FILE_OUTPUT>\"\nDouble quotes are required in most cases unless the filenames do not contain whitespaces"
test "$#" -ne 3 && exit 1 
lang_file1=$1
lang_file2=$2
lang_file3=$3
# Create an empty output file since we'll be appending
touch "$lang_file3"
cp /dev/null "$lang_file3"
# Load srt files into memory and set IFS to '#' to avoid confusion with whitespaces
file1=$(cat "$lang_file1"|sed -r ':a;N;$!ba;s/(,[[:digit:]]{3,3}\n|([[:digit:]]){1,4})\n|([[:alpha:]])\n/\1|/g'|sed -r 's/\|$/#/g')
file2=$(cat "$lang_file2"|sed -r ':a;N;$!ba;s/(,[[:digit:]]{3,3}\n|([[:digit:]]){1,4})\n/\1|/g'|sed -r 's/(.$)/\1\n/g')
IFS='#'
# Split the content.  Notice double quoting so it prints newlines
for line in `echo "$file1"`
do
     LINE=$(echo $line|awk -F'|' '{print $1}'|sed  ':a;N;$!ba;s/\n/ /g'|sed -r 's/[[:cntrl:]]//g'|sed -r 's/[[:space:]]//g')
     TIME=$(echo $line|awk -F'|' '{print $2}'|sed  ':a;N;$!ba;s/\n/ /g'|sed -r 's/[[:cntrl:]]//g'|sed -r 's/^[[:space:]]+//g')
     DIALOG=$(echo $line|cut -d'|' -f3-|sed ':a;N;$!ba;s/\n/ /g'|sed -r 's/[[:cntrl:]]//g'|sed -r 's/^[[:space:]]+//g'|sed -r 's/^[[:space:]]+//g'|sed -r 's/\|/ /g')
     DIALOG2=`echo "$file2"|grep "^$LINE|"|sed ':a;N;$!ba;s/\n|\t/ /g'|sed -r 's/[[:cntrl:]]//g'|awk -F'|' '{print $3}'|sed -r 's/^[[:space:]]+//g'`
# Display a basic progress bar
     echo -n "#"   
# Write to output file
     echo -e "$LINE\n$TIME\nl1:$DIALOG\nl2:$DIALOG2\n" >> "$lang_file3"
done
echo #
# Write a funny message
echo Thou have been served
exit 0
1
задан 20 March 2017 в 14:18

1 ответ

Войдите в свой компьютер по ssh. В своем компьютере выполните следующие команды:

sudo apt-get update
sudo apt-get install festival
echo "Wake up, anvil brain. Turn off the computer. Now!" | festival --tts

Удачи!

1
ответ дан 23 May 2018 в 14:00

Другие вопросы по тегам:

Похожие вопросы: