Commit 0e3a5765 authored by Tim Janik's avatar Tim Janik

SRC: wmget.cc: suppress non-JSON output for '--json -'

Signed-off-by: 's avatarTim Janik <timj@gnu.org>
parent 456df468
...@@ -609,7 +609,8 @@ decode_and_report (const WavData& wav_data, const string& orig_pattern) ...@@ -609,7 +609,8 @@ decode_and_report (const WavData& wav_data, const string& orig_pattern)
// speeds closer to 1.0 than this usually work without stretching before decode // speeds closer to 1.0 than this usually work without stretching before decode
if (speed < 0.9999 || speed > 1.0001) if (speed < 0.9999 || speed > 1.0001)
{ {
printf ("speed %.6f\n", speed); if (Params::json_output != "-")
printf ("speed %.6f\n", speed);
WavData wav_data_speed = resample (wav_data, Params::mark_sample_rate * speed); WavData wav_data_speed = resample (wav_data, Params::mark_sample_rate * speed);
result_set.set_speed_pattern (true); result_set.set_speed_pattern (true);
...@@ -631,7 +632,8 @@ decode_and_report (const WavData& wav_data, const string& orig_pattern) ...@@ -631,7 +632,8 @@ decode_and_report (const WavData& wav_data, const string& orig_pattern)
if (!Params::json_output.empty()) if (!Params::json_output.empty())
result_set.print_json (wav_data, Params::json_output, speed); result_set.print_json (wav_data, Params::json_output, speed);
result_set.print(); if (Params::json_output != "-")
result_set.print();
if (!orig_pattern.empty()) if (!orig_pattern.empty())
{ {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment