New voice and CN prerecorded
This commit is contained in:
1 parent
1a754bf2ac
commit
be2b17506f
3 files changed
+191
-97
No files matched your search
@@ -1,10 +1,72 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# https://brycebeattie.com/files/tts/
|
||||
#piper_voice="/opt/bin/piper/piper/piper-voices/en/en_US/lessac/medium/en_US-lessac-medium.onnx"
|
||||
piper_voice="/opt/bin/piper/piper/piper-voices/en/en_US/kristin/medium/en_US-kristin-medium.onnx"
|
||||
#
|
||||
# https://github.com/OHF-Voice/piper1-gpl
|
||||
# A fast and local neural text-to-speech engine that embeds espeak-ng for phonemization.
|
||||
# GPL-3.0 license
|
||||
#
|
||||
# https://github.com/espeak-ng/espeak-ng
|
||||
# The eSpeak NG is a compact open source software text-to-speech synthesizer for Linux, Windows, Android and other operating systems.
|
||||
# It supports more than 100 languages and accents. It is based on the eSpeak engine created by Jonathan Duddington.
|
||||
# Licenses GPL-3.0, Apache-2.0, BSD-2-Clause
|
||||
#
|
||||
# LJSpeech (high) US English female voice. Single speaker.
|
||||
# Trained from scratch for 2000 epochs on high quality settings using the LJ Speech dataset.
|
||||
# I reencoded the recordings to a bit rate of 22050 Hz so it would match other voices released for Piper TTS.
|
||||
# License: public domain
|
||||
#
|
||||
# https://keithito.com/LJ-Speech-Dataset/
|
||||
# This is a public domain speech dataset consisting of 13,100 short audio clips of a single speaker reading passages from 7 non-fiction books.
|
||||
# A transcription is provided for each clip. Clips vary in length from 1 to 10 seconds and have a total length of approximately 24 hours.
|
||||
# The texts were published between 1884 and 1964, and are in the public domain.
|
||||
# The audio was recorded in 2016-17 by the LibriVox project and is also in the public domain.
|
||||
#
|
||||
piper_voice="/opt/bin/piper/piper/piper-voices/en/en_US/ljspeech/high/en_US-ljspeech-high.onnx"
|
||||
|
||||
|
||||
function post_show_to_hpr_db() {
|
||||
|
||||
echo_debug "Retrieving information for hpr${ep_num} for release on ${ep_date}"
|
||||
|
||||
IFS='→' read -r ep_num ep_date title duration summary hostid series_id explicit license tags <<< "$( sqlite3 -separator '→' "${hpr_db}" "SELECT id, date, title, duration, summary, hostid, series, explicit, license, tags FROM eps WHERE eps.id = \"${ep_num}\" AND date = \"${ep_date}\" LIMIT 1;" )"
|
||||
|
||||
echo_debug "Posting the show to the HPR DB. post_show_to_hpr_db()"
|
||||
|
||||
if [ ! -s "${shownotes_html_edited}" ]
|
||||
then
|
||||
echo_error "Failed to find the extracted shownote html file \"${shownotes_html_edited}\""
|
||||
fi
|
||||
notes="$( cat "${shownotes_html_edited}" | jq --slurp --raw-input @uri | sed -e 's/%0A"$//g' -e 's/^"//g' )"
|
||||
title_encoded="$( echo "${title}" | jq --slurp --raw-input @uri | sed -e 's/%0A"$//g' -e 's/^"//g' )"
|
||||
summary_encoded="$( echo "${summary}" | jq --slurp --raw-input @uri | sed -e 's/%0A"$//g' -e 's/^"//g' )"
|
||||
|
||||
post_show_json="${working_dir}/post_show.json"
|
||||
|
||||
echo "{
|
||||
\"ep_num\": \"${ep_num}\",
|
||||
\"ep_date\": \"${ep_date}\",
|
||||
\"title\": \"${title_encoded}\",
|
||||
\"duration\": \"${duration}\",
|
||||
\"summary\": \"${summary_encoded}\",
|
||||
\"hostid\": \"${hostid}\",
|
||||
\"series_id\": \"${series_id}\",
|
||||
\"explicit\": \"${explicit}\",
|
||||
\"episode_license\": \"${license}\",
|
||||
\"tags\": \"${tags}\",
|
||||
\"notes\": \"${notes}\"
|
||||
}" > "${post_show_json}"
|
||||
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo_error "The file \"${post_show_json}\" is not valid json."
|
||||
fi
|
||||
|
||||
jq 'del(.notes)' post_show.json
|
||||
|
||||
curl --netrc --show-headers --request POST "https://hub.hackerpublicradio.org/cms/update_show_json.php" --header "Content-Type: application/json" --data-binary "@${post_show_json}"
|
||||
|
||||
}
|
||||
|
||||
############################################################################################
|
||||
# Update db
|
||||
@@ -12,6 +74,9 @@ piper_voice="/opt/bin/piper/piper/piper-voices/en/en_US/kristin/medium/en_US-kri
|
||||
source settings $1
|
||||
|
||||
git_dir="$HOME/tmp/hpr/hpr_generator"
|
||||
hpr_db="${git_dir}/hpr.db"
|
||||
hpr_sql="${git_dir}/hpr.sql"
|
||||
|
||||
if [ ! -d "${git_dir}/.git" ]
|
||||
then
|
||||
#git clone gitea@repo.anhonesthost.net:rho_n/hpr_generator.git "${git_dir}"
|
||||
@@ -27,19 +92,21 @@ cd "${git_dir}"
|
||||
|
||||
git pull
|
||||
|
||||
# # # # ssh hpr -t "ls -al /docker/users/hpr/userfiles/sql/hpr.sql;md5sum /docker/users/hpr/userfiles/sql/hpr.sql"
|
||||
# # # # ssh hpr -t "/docker/users/hpr/userfiles/sql/hpr_db_backup.bash"
|
||||
# # # # ssh hpr -t "ls -al /docker/users/hpr/userfiles/sql/hpr.sql;md5sum /docker/users/hpr/userfiles/sql/hpr.sql"
|
||||
# # # #
|
||||
# # # # #$HOME/tmp/hpr/hpr_generator/utils/update-hpr-db.sh
|
||||
# # # # ./utils/update-hpr-db.sh
|
||||
# # # # if [ $? -ne 0 ]
|
||||
# # # # then
|
||||
# # # # echo 'Terminating...' >&2
|
||||
# # # # exit 1
|
||||
# # # # fi
|
||||
ssh hpr -t "/docker/users/hpr/userfiles/sql/hpr_db_backup.bash"
|
||||
remote_hpr_sql_md5sum="$( ssh hpr -t "md5sum /docker/users/hpr/userfiles/sql/hpr.sql" 2>&1 | grep /docker/users/hpr/userfiles/sql/hpr.sql | awk '{print $1}' )"
|
||||
hpr_sql_md5sum="$( md5sum "${hpr_sql}" | awk '{print $1}' )"
|
||||
|
||||
hpr_db="${git_dir}/hpr.db"
|
||||
if [ "${remote_hpr_sql_md5sum}" != "${hpr_sql_md5sum}" ]
|
||||
then
|
||||
echo_debug "The hpr.sql file changed, downloading new version"
|
||||
#$HOME/tmp/hpr/hpr_generator/utils/update-hpr-db.sh
|
||||
./utils/update-hpr-db.sh
|
||||
if [ $? -ne 0 ]
|
||||
then
|
||||
echo 'Terminating...' >&2
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
|
||||
if [[ ! -s "${hpr_db}" || -z "${hpr_db}" ]]
|
||||
then
|
||||
@@ -85,8 +152,8 @@ echo_debug "The last show month was for ${previous_month}, and this month is ${t
|
||||
# Get last show info
|
||||
|
||||
IFS='|' read -r end_of_month_episode_number <<< "$(sqlite3 "${hpr_db}" "
|
||||
SELECT MAX(id) AS end_of_month_episode_number
|
||||
FROM eps
|
||||
SELECT MAX(id) AS end_of_month_episode_number
|
||||
FROM eps
|
||||
WHERE date <= \"${end_of_month_episode_date}\"
|
||||
LIMIT 1;
|
||||
")"
|
||||
@@ -99,7 +166,7 @@ echo_debug "Last episode this month is hpr${end_of_month_episode_number} release
|
||||
|
||||
this_month=$( \date --date="${month}-01 +1 month" +%Y-%m )
|
||||
|
||||
IFS='|' read -r eps_num eps_date <<< "$(sqlite3 "${hpr_db}" "
|
||||
IFS='|' read -r ep_num ep_date <<< "$(sqlite3 "${hpr_db}" "
|
||||
SELECT id, date
|
||||
FROM eps
|
||||
WHERE duration = 0
|
||||
@@ -108,17 +175,17 @@ ORDER BY date ASC
|
||||
LIMIT 1;
|
||||
")"
|
||||
|
||||
echo_debug "This is going to be hpr${eps_num} for release on ${eps_date}"
|
||||
echo_debug "This is going to be hpr${ep_num} for release on ${ep_date}"
|
||||
|
||||
eps_dir="$HOME/processing/x_${eps_num}_${eps_date}_x"
|
||||
if [ ! -d "${eps_dir}" ]
|
||||
working_dir="$HOME/processing/x_${ep_num}_${ep_date}_x"
|
||||
if [ ! -d "${working_dir}" ]
|
||||
then
|
||||
mkdir -vp "${eps_dir}"
|
||||
mkdir -vp "${working_dir}"
|
||||
fi
|
||||
|
||||
echo_debug "The episode dir is \"${eps_dir}\""
|
||||
echo_debug "The episode dir is \"${working_dir}\""
|
||||
|
||||
shownotes_html="${eps_dir}/shownotes.html"
|
||||
shownotes_html="${working_dir}/shownotes.html"
|
||||
if [ -e "${shownotes_html}" ]
|
||||
then
|
||||
rm -v "${shownotes_html}"
|
||||
@@ -128,8 +195,8 @@ if [ -e "${shownotes_html_edited}" ]
|
||||
then
|
||||
rm -v "${shownotes_html_edited}"
|
||||
fi
|
||||
shownotes_recordings_dir="${eps_dir}/Recordings"
|
||||
comment_script_md="${eps_dir}/script.md"
|
||||
shownotes_recordings_dir="${working_dir}/Recordings"
|
||||
comment_script_md="${working_dir}/script.md"
|
||||
if [ -e "${comment_script_md}" ]
|
||||
then
|
||||
rm -v "${comment_script_md}"
|
||||
@@ -140,6 +207,19 @@ then
|
||||
mkdir -vp "${shownotes_recordings_dir}"
|
||||
fi
|
||||
|
||||
############################################################################################
|
||||
# Call to action
|
||||
|
||||
echo "<h2>Recording Comments</h2>
|
||||
<p>We would love it if you could assist with the recording of comments for this episode.</p>
|
||||
<ol>
|
||||
<li>Install <a href=\"https://gitlab.com/norrist/solocast\">https://gitlab.com/norrist/solocast</a></li>
|
||||
<li>Install <a href=\"https://syncthing.net/\">Syncthing</a></li>
|
||||
<li>Contact the <a href=\"https://hackerpublicradio.org/about.html#contact\">Janitors</a> to get access to the shared folder for completed Recordings</li>
|
||||
</ol>
|
||||
<p>Selecting <em>solocast record</em> will allow you to record a comment or post, which syncthing will syncronise to the rest of the team.</p>" | tee --append "${shownotes_html_edited}" >> "${shownotes_html}"
|
||||
|
||||
|
||||
############################################################################################
|
||||
# Add New hosts to shownotes
|
||||
|
||||
@@ -191,12 +271,12 @@ if [ -z "${results}" ]
|
||||
then
|
||||
echo_error "There were no shows found for this month."
|
||||
else
|
||||
while IFS="→" read -r eps_id host title eps_date hostid
|
||||
while IFS="→" read -r eps_id host title this_ep_date hostid
|
||||
do
|
||||
echo "<tr>" | tee --append "${shownotes_html_edited}" >> "${shownotes_html}"
|
||||
echo "<td><strong><a href=\"https://hackerpublicradio.org/eps/hpr${eps_id}/index.html\" target=\"_blank\">${eps_id}</a></strong></td>" | tee --append "${shownotes_html_edited}" >> "${shownotes_html}"
|
||||
echo "<td>$( \date --date=${eps_date} +%a )</td>" | tee --append "${shownotes_html_edited}" >> "${shownotes_html}"
|
||||
echo "<td class=\"shrink\">${eps_date}</td>" | tee --append "${shownotes_html_edited}" >> "${shownotes_html}"
|
||||
echo "<td>$( \date --date=${this_ep_date} +%a )</td>" | tee --append "${shownotes_html_edited}" >> "${shownotes_html}"
|
||||
echo "<td class=\"shrink\">${this_ep_date}</td>" | tee --append "${shownotes_html_edited}" >> "${shownotes_html}"
|
||||
echo "<td><a href=\"https://hackerpublicradio.org/eps/hpr${eps_id}/index.html\" target=\"_blank\">${title}</a></td>" | tee --append "${shownotes_html_edited}" >> "${shownotes_html}"
|
||||
echo "<td><a href=\"https://hackerpublicradio.org/correspondents/${hostid}.html\" target=\"_blank\">${host}</a></td>" | tee --append "${shownotes_html_edited}" >> "${shownotes_html}"
|
||||
latest_episode=${eps_id}
|
||||
@@ -220,40 +300,40 @@ function render_comments() {
|
||||
this_comment="0"
|
||||
open_line="0"
|
||||
echo "<ul>" | tee --append "${shownotes_html_edited}" >> "${shownotes_html}"
|
||||
while IFS="→" read -r comments_id comments_eps_id eps_date eps_title hosts_host hosts_hostid comments_comment_author_name comments_comment_timestamp comments_comment_title
|
||||
while IFS="→" read -r comments_id comments_eps_id this_ep_date eps_title hosts_host hosts_hostid comments_comment_author_name comments_comment_timestamp comments_comment_title
|
||||
do
|
||||
|
||||
echo "# Comment${comments_id}Vvvvvvvvvvvvvvvvvvvvvvvvvvvv" | tee --append "${comment_script_md}"
|
||||
echo "${eps_title} by ${hosts_host}" | tee --append "${comment_script_md}"
|
||||
echo "- https://hackerpublicradio.org/eps/hpr${comments_eps_id}/index.html#comment_${comments_id} (${eps_date})" | tee --append "${comment_script_md}"
|
||||
echo "- https://hackerpublicradio.org/correspondents/${hosts_hostid}.html" | tee --append "${comment_script_md}"
|
||||
|
||||
echo "# Comment${comments_id}Vvvvvvvvvvvvvvvvvvvvvvvvvvvv" >> "${comment_script_md}"
|
||||
echo "${eps_title} by ${hosts_host}" >> "${comment_script_md}"
|
||||
echo "- https://hackerpublicradio.org/eps/hpr${comments_eps_id}/index.html#comment_${comments_id} (${this_ep_date})" >> "${comment_script_md}"
|
||||
echo "- https://hackerpublicradio.org/correspondents/${hosts_hostid}.html" >> "${comment_script_md}"
|
||||
|
||||
comment_script_txt="${shownotes_recordings_dir}/Comment${comments_id}.txt"
|
||||
comment_script_piper="${shownotes_recordings_dir}/Comment${comments_id}_piper.wav"
|
||||
comment_script_espeak="${shownotes_recordings_dir}/Comment${comments_id}_espeak.wav"
|
||||
|
||||
echo "${comments_comment_author_name} said: «${comments_comment_title}»" | tee "${comment_script_txt}"
|
||||
|
||||
sqlite3 "${hpr_db}" "SELECT comments.comment_text AS comment_text FROM comments WHERE comments.id = ${comments_id};" | tee --append "${comment_script_txt}"
|
||||
|
||||
echo "${comments_comment_text}" | tee --append "${comment_script_txt}"
|
||||
|
||||
echo "" | tee --append "${comment_script_txt}"
|
||||
|
||||
echo "${comments_comment_author_name} said: «${comments_comment_title}»" > "${comment_script_txt}"
|
||||
|
||||
sqlite3 "${hpr_db}" "SELECT comments.comment_text AS comment_text FROM comments WHERE comments.id = ${comments_id};" >> "${comment_script_txt}"
|
||||
|
||||
echo "${comments_comment_text}" >> "${comment_script_txt}"
|
||||
|
||||
echo "" >> "${comment_script_txt}"
|
||||
|
||||
cat "${comment_script_txt}" >> "${comment_script_md}"
|
||||
|
||||
|
||||
if [ ! -e "${comment_script_piper}" ]
|
||||
then
|
||||
echo_debug "Genereating piper \"${comment_script_piper}\""
|
||||
piper --model "${piper_voice}" --input-file "${comment_script_txt}" --output_file "${comment_script_piper}"
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -e "${comment_script_espeak}" ]
|
||||
then
|
||||
echo_debug "Genereating espeak \"${comment_script_espeak}\""
|
||||
espeak -f "${comment_script_txt}" -w "${comment_script_espeak}"
|
||||
fi
|
||||
|
||||
|
||||
if [ "${this_comment}" -ne "${comments_eps_id}" ]
|
||||
then
|
||||
if [ "${open_line}" -ne "0" ]
|
||||
@@ -262,42 +342,42 @@ function render_comments() {
|
||||
fi
|
||||
open_line="1"
|
||||
this_comment="${comments_eps_id}"
|
||||
echo "<li><strong><a href=\"https://hackerpublicradio.org/eps/hpr${comments_eps_id}/index.html#comments\" target=\"_blank\">hpr${comments_eps_id}</a></strong> (${eps_date}) \"<em>${eps_title}</em>\" by <a href=\"https://hackerpublicradio.org/correspondents/${hosts_hostid}.html\" target=\"_blank\">${hosts_host}</a>.<br></li>" | tee --append "${shownotes_html_edited}" >> "${shownotes_html}"
|
||||
echo "<li><strong><a href=\"https://hackerpublicradio.org/eps/hpr${comments_eps_id}/index.html#comments\" target=\"_blank\">hpr${comments_eps_id}</a></strong> (${this_ep_date}) \"<em>${eps_title}</em>\" by <a href=\"https://hackerpublicradio.org/correspondents/${hosts_hostid}.html\" target=\"_blank\">${hosts_host}</a>.<br></li>" | tee --append "${shownotes_html_edited}" >> "${shownotes_html}"
|
||||
echo "<ul>" | tee --append "${shownotes_html_edited}" >> "${shownotes_html}"
|
||||
fi
|
||||
echo "<li style=\"list-style: none; display: inline\"><strong>${comments_comment_author_name}</strong> said: \"<em><a href=\"https://hackerpublicradio.org/eps/hpr${comments_eps_id}/index.html#comment_${comments_id}\" target=\"_blank\">${comments_comment_title}</a></em>\" (${comments_comment_timestamp})<br/></li>" | tee --append "${shownotes_html_edited}" >> "${shownotes_html}"
|
||||
|
||||
|
||||
comment_script_txt="${shownotes_recordings_dir}/Comment${comments_id}.txt"
|
||||
comment_script_piper="${shownotes_recordings_dir}/Comment${comments_id}_piper.wav"
|
||||
comment_script_espeak="${shownotes_recordings_dir}/Comment${comments_id}_espeak.wav"
|
||||
comment_script_narration="${shownotes_recordings_dir}/Comment${comments_id}Vvvvvvvvvvvvvvvvvvvvvvvvvvv.wav"
|
||||
|
||||
echo "<ul>" | tee --append "${shownotes_html_edited}"
|
||||
|
||||
echo "<ul>" >> "${shownotes_html_edited}"
|
||||
if [ -e "${comment_script_narration}" ]
|
||||
then
|
||||
comment_script_narration_web="./Recordings/$( basename "${comment_script_narration}" )"
|
||||
echo "<li><audio controls=\"\" preload=\"none\" >
|
||||
<source src=\"${comment_script_narration_web}\" type=\"audio/x-wav\">
|
||||
</audio>" | tee --append "${shownotes_html_edited}"
|
||||
</audio>" >> "${shownotes_html_edited}"
|
||||
fi
|
||||
|
||||
|
||||
if [ -e "${comment_script_piper}" ]
|
||||
then
|
||||
comment_script_piper_web="./Recordings/$( basename "${comment_script_piper}" )"
|
||||
echo "<audio controls=\"\" preload=\"none\" >
|
||||
<source src=\"${comment_script_piper_web}\" type=\"audio/x-wav\">
|
||||
</audio>" | tee --append "${shownotes_html_edited}"
|
||||
</audio>" >> "${shownotes_html_edited}"
|
||||
fi
|
||||
|
||||
|
||||
if [ -e "${comment_script_espeak}" ]
|
||||
then
|
||||
comment_script_espeak_web="./Recordings/$( basename "${comment_script_espeak}" )"
|
||||
echo "<audio controls=\"\" preload=\"none\" >
|
||||
<source src=\"${comment_script_espeak_web}\" type=\"audio/x-wav\">
|
||||
</audio></li>" | tee --append "${shownotes_html_edited}"
|
||||
</audio></li>" >> "${shownotes_html_edited}"
|
||||
fi
|
||||
echo "</ul>" | tee --append "${shownotes_html_edited}"
|
||||
|
||||
echo "</ul>" >> "${shownotes_html_edited}"
|
||||
|
||||
latest_comment="${comments_id}"
|
||||
done <<< "${results}"
|
||||
echo "</ul>" | tee --append "${shownotes_html_edited}" >> "${shownotes_html}"
|
||||
@@ -370,13 +450,12 @@ do
|
||||
this_post_html="${shownotes_recordings_dir}/Post${this_post%.*}.html"
|
||||
if [ ! -e ${this_post_html} ]
|
||||
then
|
||||
wget ${mailman_base}/${this_post} --output-document=${this_post_html}
|
||||
wget ${mailman_base}/${this_post} --output-document=${this_post_html}
|
||||
fi
|
||||
|
||||
this_post_txt="${shownotes_recordings_dir}/Post${this_post%.*}.txt"
|
||||
if [ ! -e ${this_post_txt} ]
|
||||
then
|
||||
echo "# Post${this_post%.*}vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv" > "${this_post_txt}"
|
||||
grep ' <B>' "${this_post_html}" | tee --append "${this_post_txt}"
|
||||
sed --quiet --expression='/<!--beginarticle-->/,/<!--endarticle-->/{ /<!--beginarticle-->/d; /<!--endarticle-->/d; p; }' "${this_post_html}" | tee --append "${this_post_txt}"
|
||||
sed -e 's#^ <B>##g' -e 's#</B># says:#g' -e 's#<PRE>##g' -e 's#</PRE>##g' -i "${this_post_txt}"
|
||||
@@ -388,7 +467,7 @@ do
|
||||
this_post_name="$( basename "${this_post}" )"
|
||||
if [ "$( find ${shownotes_recordings_dir} -type f -iname "${this_post_name%.*}*.wav" | wc -l )" -eq "0" ]
|
||||
then
|
||||
kate -n "${this_post}" >/dev/null 2>&1 &
|
||||
kate "${this_post}" >/dev/null 2>&1 &
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -401,30 +480,30 @@ then
|
||||
echo_error "The final review was not approved."
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
for this_post in ${shownotes_recordings_dir}/Post*txt
|
||||
do
|
||||
echo " " >> ${comment_script_md}
|
||||
cat ${this_post} >> ${comment_script_md}
|
||||
|
||||
post_id="$( basename "${this_post%.*}" )"
|
||||
post_script_txt="${shownotes_recordings_dir}/${post_id}.txt"
|
||||
post_script_piper="${shownotes_recordings_dir}/${post_id}_piper.wav"
|
||||
post_script_espeak="${shownotes_recordings_dir}/${post_id}_espeak.wav"
|
||||
|
||||
|
||||
|
||||
echo " " >> ${comment_script_md}
|
||||
echo "# ${post_id%.*}vvvvvvvvvvvvvvvvvvvvvvvvvvvvvv" >> ${comment_script_md}
|
||||
cat ${this_post} >> ${comment_script_md}
|
||||
|
||||
if [ ! -e "${post_script_piper}" ]
|
||||
then
|
||||
echo_debug "Genereating piper \"${post_script_piper}\""
|
||||
piper --model "${piper_voice}" --input-file "${post_script_txt}" --output_file "${post_script_piper}"
|
||||
fi
|
||||
|
||||
|
||||
if [ ! -e "${post_script_espeak}" ]
|
||||
then
|
||||
echo_debug "Genereating espeak \"${post_script_espeak}\""
|
||||
espeak -f "${post_script_txt}" -w "${post_script_espeak}"
|
||||
fi
|
||||
|
||||
|
||||
done
|
||||
|
||||
echo "<h2>Mailing List discussions</h2>" | tee --append "${shownotes_html_edited}" >> "${shownotes_html}"
|
||||
@@ -438,50 +517,64 @@ and available on the HPR server under <a href=\"https://lists.hackerpublicradio.
|
||||
|
||||
echo "<UL>" | tee --append "${shownotes_html_edited}" >> "${shownotes_html}"
|
||||
|
||||
|
||||
# <!--0 01793572759.5072- -->
|
||||
# <LI><A HREF="005072.html">[Hpr] Community News Clone Voices
|
||||
# </A><A NAME="5072"> </A>
|
||||
# <I>Paul Jewell
|
||||
# </I>
|
||||
|
||||
sed --null-data "s/\n//g" thread.html | \
|
||||
sed --expression='s/<LI>/\n<LI>/g' --expression='s#</LI>#</LI>\n#g' --expression='s#<UL>#\n<UL>\n#g' --expression='s#</UL>#\n</UL>\n#g' --expression='s#<ul>#\n<ul>\n#g' --expression='s#</ul>#\n</ul>\n#g' | \
|
||||
sed --expression='s/<LI>/\n<LI>/g' \
|
||||
--expression='s#</LI>#</LI>\n#g' \
|
||||
--expression='s#<UL>#\n<UL>\n#g' \
|
||||
--expression='s#</UL>#\n</UL>\n#g' \
|
||||
--expression='s#<ul>#\n<ul>\n#g' \
|
||||
--expression='s#</ul>#\n</ul>\n#g' | \
|
||||
grep --perl-regexp -- '<LI>|</LI>|<UL>|</UL>' | while read this_post_line
|
||||
do
|
||||
if [ "$( echo "${this_post_line}" | grep --count '<LI>' )" ]
|
||||
if [ "$( echo "${this_post_line}" | grep --count '<UL></LI>' )" -eq "1" ]
|
||||
then
|
||||
echo "${this_post_line}</LI>" | tee --append "${shownotes_html_edited}" >> "${shownotes_html}"
|
||||
### <LI><A HREF="005073.html">[Hpr] Community News Clone Voices</A><A NAME="5073"> </A><I>candy</I><!--1 01793572759.5072-01793614515.5074- --></LI>
|
||||
echo "${this_post_line} ⋄⋄" | tee --append "${shownotes_html_edited}" >> "${shownotes_html}"
|
||||
fi
|
||||
|
||||
post_id="$( echo "${this_post_line}" | awk -F '"' '{print "Post"$2}' | sed 's/\.html//g' )"
|
||||
if [ "$( echo "${this_post_line}" | grep --count '<LI>' )" -eq "1" ]
|
||||
then
|
||||
|
||||
IFS='→' read -r this_post_html this_post_title this_post_name <<< "$( echo "${this_post_line}" | awk -F '"|<|>|/' '{print $5"→"$7"→"$19}' )"
|
||||
echo "<li><a href=\"${mailman_base}/${this_post_html}\">${this_post_title}</a> by <i>${this_post_name}</i></li>" | tee --append "${shownotes_html_edited}" >> "${shownotes_html}"
|
||||
|
||||
post_id="Post$( echo "${this_post_html}" | sed 's/\.html//g' )"
|
||||
post_script_narration="${shownotes_recordings_dir}/${post_id}Vvvvvvvvvvvvvvvvvvvvvvvvvvvv.wav"
|
||||
post_script_piper="${shownotes_recordings_dir}/${post_id}_piper.wav"
|
||||
post_script_espeak="${shownotes_recordings_dir}/${post_id}_espeak.wav"
|
||||
|
||||
echo "<ul>" | tee --append "${shownotes_html_edited}"
|
||||
echo "<ul>" >> "${shownotes_html_edited}"
|
||||
if [ -e "${post_script_narration}" ]
|
||||
then
|
||||
post_script_narration_web="./Recordings/$( basename "${post_script_narration}" )"
|
||||
echo "<li><audio controls=\"\" preload=\"none\" >
|
||||
<source src=\"${post_script_narration_web}\" type=\"audio/x-wav\">
|
||||
</audio>" | tee --append "${shownotes_html_edited}"
|
||||
</audio>" >> "${shownotes_html_edited}"
|
||||
fi
|
||||
|
||||
|
||||
if [ -e "${post_script_piper}" ]
|
||||
then
|
||||
post_script_piper_web="./Recordings/$( basename "${post_script_piper}" )"
|
||||
echo "<audio controls=\"\" preload=\"none\" >
|
||||
<source src=\"${post_script_piper_web}\" type=\"audio/x-wav\">
|
||||
</audio>" | tee --append "${shownotes_html_edited}"
|
||||
</audio>" >> "${shownotes_html_edited}"
|
||||
fi
|
||||
|
||||
|
||||
if [ -e "${post_script_espeak}" ]
|
||||
then
|
||||
post_script_espeak_web="./Recordings/$( basename "${post_script_espeak}" )"
|
||||
echo "<audio controls=\"\" preload=\"none\" >
|
||||
<source src=\"${post_script_espeak_web}\" type=\"audio/x-wav\">
|
||||
</audio></li>" | tee --append "${shownotes_html_edited}"
|
||||
</audio></li>" >> "${shownotes_html_edited}"
|
||||
fi
|
||||
echo "</ul>" | tee --append "${shownotes_html_edited}"
|
||||
|
||||
|
||||
|
||||
echo "</ul>" >> "${shownotes_html_edited}"
|
||||
else
|
||||
echo "${this_post_line}" | tee --append "${shownotes_html_edited}" >> "${shownotes_html}"
|
||||
echo "${this_post_line}" | tee --append "${shownotes_html_edited}" >> "${shownotes_html}"
|
||||
fi
|
||||
done
|
||||
|
||||
@@ -499,7 +592,7 @@ page.</blockquote>" | tee --append "${shownotes_html_edited}" >> "${shownotes_ht
|
||||
latest_comment=$(sqlite3 "${hpr_db}" "SELECT MAX(id) FROM comments;")
|
||||
echo "<!-- HPRCN:month=${this_month},latest_comment=${latest_comment},latest_host=${newest_host},latest_episode=${latest_episode} -->" | tee --append "${shownotes_html_edited}" >> "${shownotes_html}"
|
||||
|
||||
cd "${eps_dir}"
|
||||
cd "${working_dir}"
|
||||
|
||||
while [ "$( $HOME/sourcecode/hpr/solocast/solocast/solocast.py status | grep --count 'All Segments Recorded' )" == "0" ]
|
||||
do
|
||||
@@ -508,12 +601,9 @@ do
|
||||
sleep 1
|
||||
done
|
||||
|
||||
# # # for audio_wav in "${shownotes_recordings_dir}"/*.wav
|
||||
# # # do
|
||||
# # # if [ ! -e "${audio_wav%.*}.mp3" ]
|
||||
# # # then
|
||||
# # # ffmpeg -i "${audio_wav}" "${audio_wav%.*}.mp3"
|
||||
# # # fi
|
||||
# # # done
|
||||
# # #
|
||||
# # #
|
||||
rsync -av --partial --progress ${working_dir}/Recordings/ hpr:hackerpublicradio.org/public_html/eps/hpr${ep_num}/Recordings/
|
||||
rsync -av --partial --progress ${working_dir}/script.md hpr:hackerpublicradio.org/public_html/eps/hpr${ep_num}/script.md
|
||||
|
||||
post_show_to_hpr_db
|
||||
|
||||
echo_debug "The End."
|
||||
Reference in new issue
Block a user