- Timestamp:
- Aug 12, 2015, 4:31:40 PM (9 years ago)
- Branches:
- feature/autosink, feature/cnn, feature/cnn_org, feature/constantq, feature/crepe, feature/crepe_org, feature/pitchshift, feature/pydocstrings, feature/timestretch, fix/ffmpeg5, master, pitchshift, sampler, timestretch, yinfft+
- Children:
- 3ff50e5
- Parents:
- 340cb93
- Location:
- examples
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/aubioonset.c
r340cb93 rdf7be43 50 50 { 51 51 if ( is_onset ) { 52 if (strcmp (time_format, "samples") == 0) { 53 outmsg ("%d\n", aubio_onset_get_last (o) ); 54 } else if (strcmp (time_format, "ms") == 0) { 55 outmsg ("%f\n", aubio_onset_get_last_ms (o) ); 56 } else { 57 outmsg ("%f\n", aubio_onset_get_last_s (o) ); 58 } 52 print_time(aubio_onset_get_last (o)); 53 outmsg ("\n"); 59 54 } 60 55 } -
examples/parse_args.h
r340cb93 rdf7be43 36 36 extern smpl_t pitch_tolerance; 37 37 // time stuff 38 extern char_t *time_format;38 extern uint_t time_format; 39 39 // tempo stuff 40 40 extern char_t * tempo_method; … … 209 209 break; 210 210 case 'T': 211 time_format = optarg; 211 if (strcmp (optarg, "samples") == 0) { 212 time_format = 2; 213 } else if (strcmp (optarg, "ms") == 0) { 214 time_format = 1; 215 } else if (strcmp (optarg, "seconds") == 0) { 216 time_format = 0; 217 } else { 218 errmsg ("Warning: did not get '%s' time-format string\n", optarg); 219 } 212 220 break; 213 221 case 's': /* silence threshold */ -
examples/utils.c
r340cb93 rdf7be43 49 49 smpl_t pitch_tolerance = 0.0; // will be set if != 0. 50 50 // time stuff 51 char_t * time_format = "seconds"; 51 uint_t time_format = 0; // for "seconds", 1 for "ms", 2 for "samples" 52 52 // tempo stuff 53 53 char_t * tempo_method = "default"; … … 210 210 void print_time (uint_t time_in_samples) { 211 211 /* output times in selected format */ 212 if ( strcmp (time_format, "samples") == 0) {212 if (time_format == 2) { 213 213 outmsg ("%d", time_in_samples); 214 } else if ( strcmp (time_format, "ms") == 0) {214 } else if (time_format == 1) { 215 215 outmsg ("%f", 1000. * time_in_samples / (float) samplerate); 216 216 } else {
Note: See TracChangeset
for help on using the changeset viewer.