Skip to content

Commit

Permalink
Update call_concluder.cc
Browse files Browse the repository at this point in the history
Changing upload script call
Normalization now called on the combined file
  • Loading branch information
robotastic committed Mar 22, 2022
1 parent 8822c74 commit 36aae6b
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions trunk-recorder/call_concluder/call_concluder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,8 @@ std::list<Call_Data_t> Call_Concluder::retry_call_list = {};
int combine_wav(std::string files, char *target_filename) {
char shell_command[4000];

int nchars = snprintf(shell_command, 4000, "sox %s %s --norm=-.01", files.c_str(), target_filename);

int nchars = snprintf(shell_command, 4000, "sox %s %s ", files.c_str(), target_filename);

if (nchars >= 4000) {
BOOST_LOG_TRIVIAL(error) << "Call uploader: SOX Combine WAV Command longer than 4000 characters";
Expand All @@ -31,7 +32,7 @@ int combine_wav(std::string files, char *target_filename) {
int convert_media(char *filename, char *converted) {
char shell_command[400];

int nchars = snprintf(shell_command, 400, "sox %s -t wav - | fdkaac --silent -p 2 --ignorelength -b 8000 -o %s -", filename, converted);
int nchars = snprintf(shell_command, 400, "sox %s --norm -t wav - | fdkaac --silent -p 2 --ignorelength -b 8000 -o %s -", filename, converted);

if (nchars >= 400) {
BOOST_LOG_TRIVIAL(error) << "Call uploader: Command longer than 400 characters";
Expand Down Expand Up @@ -194,7 +195,7 @@ Call_Data_t upload_call_worker(Call_Data_t call_info) {

// Handle the Upload Script, if set
if (call_info.upload_script.length() != 0) {
shell_command << "./" << call_info.upload_script << " " << call_info.filename << " " << call_info.status_filename << " " << call_info.converted;
shell_command << call_info.upload_script << " " << call_info.filename << " " << call_info.status_filename << " " << call_info.converted;
shell_command_string = shell_command.str();

BOOST_LOG_TRIVIAL(info) << "[" << call_info.short_name << "]\t\033[0;34m" << call_info.call_num << "C\033[0m \t Running upload script: " << shell_command_string;
Expand Down

0 comments on commit 36aae6b

Please sign in to comment.