From 627ce51138603cfee75e8f7b1a5f18a2d038a2db Mon Sep 17 00:00:00 2001 From: porres Date: Wed, 29 Jan 2025 14:10:54 -0300 Subject: [PATCH] sfload help --- Documentation/Help-files/sfload-help.pd | 19 ++++++++++++------- Source/Control/sfload.c | 10 ++++------ 2 files changed, 16 insertions(+), 13 deletions(-) diff --git a/Documentation/Help-files/sfload-help.pd b/Documentation/Help-files/sfload-help.pd index bee44ee40..25a79ba19 100644 --- a/Documentation/Help-files/sfload-help.pd +++ b/Documentation/Help-files/sfload-help.pd @@ -20,17 +20,22 @@ #X obj 7 394 cnv 3 550 3 empty empty arguments 8 12 0 13 #dcdcdc #000000 0; #X obj 120 309 cnv 17 3 37 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0; #X text 68 91 [sfload] is similar to [soundfiler] but supports MP3 \, FLAC \, WAV \, AIF \, AAC \, OGG & OPUS filie extensions., f 64; -#X msg 110 198 load bubul.mp3; -#X obj 110 229 else/sfload \$0-file; -#X obj 110 168 loadbang; -#X obj 270 150 cnv 16 190 120 empty empty empty 20 12 0 10 #e0e0e0 #404040 0; +#X msg 55 176 load bubul.mp3; +#X obj 55 207 else/sfload \$0-file; +#X obj 55 146 loadbang; +#X obj 244 146 cnv 16 245 90 empty empty empty 20 12 0 10 #e0e0e0 #404040 0; #N canvas 0 22 450 278 (subpatch) 0; #X array \$0-file 534167 float 2; -#X coords 0 1 534167 -1 192 122 1 0 0; -#X restore 269 149 graph; +#X coords 0 1 534167 -1 247 92 1 0 0; +#X restore 243 145 graph; #X text 152 310 load - load a file into an array, f 48; #X text 158 327 set - set array name, f 47; -#X text 234 368 NONE; #X text 167 405 1) symbol - array name (default: none); +#X listbox 55 239 24 0 0 0 - - - 0; +#X text 207 238 *; +#X text 55 264 * ; +#X obj 120 369 cnv 17 3 17 empty empty 0 5 9 0 16 #dcdcdc #9c9c9c 0; +#X text 158 371 list - size \, sample rate \, channels \, bits \, loop regions; #X connect 17 0 18 0; +#X connect 18 0 25 0; #X connect 19 0 17 0; diff --git a/Source/Control/sfload.c b/Source/Control/sfload.c index f99505387..256f0b2cf 100644 --- a/Source/Control/sfload.c +++ b/Source/Control/sfload.c @@ -118,14 +118,12 @@ void* sfload_read_audio(void *arg){ // read audio into array } av_packet_unref(x->x_pkt); } - - SETFLOAT(x->x_sfinfo, x->x_stream_ctx->sample_rate); - SETFLOAT(x->x_sfinfo + 1, nch); - SETFLOAT(x->x_sfinfo + 2, av_get_bytes_per_sample(x->x_stream_ctx->sample_fmt) * 8); - SETFLOAT(x->x_sfinfo + 3, output_index); + SETFLOAT(x->x_sfinfo + 0, output_index); + SETFLOAT(x->x_sfinfo + 1, x->x_stream_ctx->sample_rate); + SETFLOAT(x->x_sfinfo + 2, nch); + SETFLOAT(x->x_sfinfo + 3, av_get_bytes_per_sample(x->x_stream_ctx->sample_fmt) * 8); SETFLOAT(x->x_sfinfo + 4, loop_start_entry ? atoi(loop_start_entry->value) : 0); SETFLOAT(x->x_sfinfo + 5, loop_end_entry ? atoi(loop_end_entry->value) : 0); - x->x_result_ready = output_index; av_free(x_out); return (NULL);