diff --git a/i_sndfile/i_sndfile.cpp b/i_sndfile/i_sndfile.cpp index f303bf0973c42978fb3d22c6d68d064c219c3cd2..d633213ec3540fb9a8e5c8a6496ff61ba091828c 100644 --- a/i_sndfile/i_sndfile.cpp +++ b/i_sndfile/i_sndfile.cpp @@ -16,13 +16,19 @@ int main(int argc, char**argv){ SNDFILE *sndfile; sf_count_t read_items_nb; + blc_program_set_description("Record blc_channel input in a sound file"); + blc_program_add_option(&filename, 'f', "file", "string", "filename of the file to write", NULL); blc_program_add_option(&output_name, 'o', "output", "string", "Channel containing the fast fourier transformation", DEFAULT_OUTPUT_NAME); blc_program_add_option(&period_str, 'p', "period", "integer", "Period between each sample in ms (0 as fast as possible)", "0"); blc_program_add_option(&length_str, 's', "size", "integer", "Sample size", "1024"); blc_program_add_option(&type_str, 't', "type", "INT8|FL32", "Type of the data.", "FL32"); - blc_program_add_parameter(&filename, "string", 1, "Filename containing the sound", NULL); blc_program_init(&argc, &argv, NULL); + if (filename==NULL){ + blc_program_args_display_help(); + EXIT_ON_ERROR("You need to specify a filename: -f<filename>"); + } + type=STRING_TO_UINT32(type_str); if (sscanf(length_str, "%ld", &length)!=1) EXIT_ON_ERROR("Reading size '%s'", length_str); if (sscanf(period_str, "%d", &period)!=1) EXIT_ON_ERROR("Reading period in '%s'", period_str); diff --git a/o_sndfile/o_sndfile.cpp b/o_sndfile/o_sndfile.cpp index 6dfee71746f4447a3b235b2f20925323905a7ffc..cc766c4d7c00361892bc45d1d5db1aff7ae2f5e6 100644 --- a/o_sndfile/o_sndfile.cpp +++ b/o_sndfile/o_sndfile.cpp @@ -11,6 +11,7 @@ int main(int argc, char**argv){ SNDFILE *sndfile; sf_count_t write_items_nb; + blc_program_set_description("Load a sound file (no mp3) and put the result in the blc_channel"); blc_program_add_option(&filename, 'f', "file", "string", "filename of the file to write", NULL); blc_program_add_parameter(&input_name, "blc_channel-in", 1, "blc channel containing the sound", NULL); blc_program_init(&argc, &argv, NULL);