What is the optimal encoding and sample rate to send to Deepgram?
declare -a voices=(
"aura-asteria-en"
)
declare -a encodings=(
"mulaw"
"linear16"
)
declare -a sample_rates=(
"8000"
"16000"
)
declare -a sentences=(
"Hello welcome to deepgram, how can I help you today? This is a much longer piece of text that should take longer to process. There are many extra words that will increase the processing time. Here is another sentence that will add to the duration of audio"
)
for voice in "${voices[@]}"
do
for encoding in "${encodings[@]}"
do
for sample_rate in "${sample_rates[@]}"
do
for sentence in "${sentences[@]}"
do
echo "https://api.deepgram.com/v1/speak?model=$voice&encoding=$encoding&sample_rate=$sample_rate"
time curl -H "Authorization: Token $DEEPGRAM_API_KEY" -X POST --header "Content-Type: application/json" -d "{\"text\":\"$sentence\"}" "https://api.deepgram.com/v1/speak?model=$voice&encoding=$encoding&sample_rate=$sample_rate" > "$voice-$encoding-$sample_rate.mp3"
done
done
done
doneLast updated