Skip to content

Commit

Permalink
sfload help
Browse files Browse the repository at this point in the history
  • Loading branch information
porres committed Jan 29, 2025
1 parent fc4abef commit 627ce51
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 13 deletions.
19 changes: 12 additions & 7 deletions Documentation/Help-files/sfload-help.pd
Original file line number Diff line number Diff line change
Expand Up @@ -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 <symbol> - load a file into an array, f 48;
#X text 158 327 set <symbol> - 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 * <nsamples \, sample rate \, nchannels \, bits \, loop regions>;
#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;
10 changes: 4 additions & 6 deletions Source/Control/sfload.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 627ce51

Please sign in to comment.