- Timestamp:
- Aug 9, 2005, 7:56:21 PM (19 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:
- a29ad46
- Parents:
- 28d8c4a
- Location:
- examples
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
examples/utils.c
r28d8c4a r5e9c68a 40 40 41 41 42 aubio_ file_t * file = NULL;43 aubio_ file_t * fileout = NULL;42 aubio_sndfile_t * file = NULL; 43 aubio_sndfile_t * fileout = NULL; 44 44 45 45 aubio_pvoc_t * pv; … … 59 59 smpl_t pitch = 0.; 60 60 aubio_pitchdetection_t * pitchdet; 61 aubio_pitchdetection_type mode = aubio_ yin; // aubio_mcomb61 aubio_pitchdetection_type mode = aubio_pitch_yin; // aubio_pitch_mcomb 62 62 uint_t median = 6; 63 63 … … 205 205 206 206 207 aubio_ file_t * onsetfile;207 aubio_sndfile_t * onsetfile; 208 208 /* parse command line arguments */ 209 209 parse_args(argc, argv); … … 211 211 woodblock = new_fvec(buffer_size,1); 212 212 if (output_filename || usejack) { 213 (onsetfile = new_ file_ro(onset_filename)) ||214 (onsetfile = new_ file_ro("sounds/woodblock.aiff")) ||215 (onsetfile = new_ file_ro("../sounds/woodblock.aiff"));213 (onsetfile = new_aubio_sndfile_ro(onset_filename)) || 214 (onsetfile = new_aubio_sndfile_ro("sounds/woodblock.aiff")) || 215 (onsetfile = new_aubio_sndfile_ro("../sounds/woodblock.aiff")); 216 216 /* read the output sound once */ 217 file_read(onsetfile, overlap_size, woodblock);217 aubio_sndfile_read(onsetfile, overlap_size, woodblock); 218 218 } 219 219 … … 221 221 { 222 222 debug("Opening files ...\n"); 223 file = new_ file_ro (input_filename);224 if (verbose) file_info(file);225 channels = aubio_ file_channels(file);226 samplerate = aubio_ file_samplerate(file);223 file = new_aubio_sndfile_ro (input_filename); 224 if (verbose) aubio_sndfile_info(file); 225 channels = aubio_sndfile_channels(file); 226 samplerate = aubio_sndfile_samplerate(file); 227 227 if (output_filename != NULL) 228 fileout = new_ file_wo(file, output_filename);228 fileout = new_aubio_sndfile_wo(file, output_filename); 229 229 } 230 230 … … 235 235 if (usepitch) { 236 236 pitchdet = new_aubio_pitchdetection(buffer_size*4, 237 overlap_size, channels, samplerate, mode, aubio_ freq);237 overlap_size, channels, samplerate, mode, aubio_pitchm_freq); 238 238 239 239 if (median) { … … 306 306 frames = 0; 307 307 308 while (overlap_size == file_read(file, overlap_size, ibuf))308 while (overlap_size == aubio_sndfile_read(file, overlap_size, ibuf)) 309 309 { 310 310 isonset=0; … … 312 312 print(); 313 313 if (output_filename != NULL) { 314 file_write(fileout,overlap_size,obuf);314 aubio_sndfile_write(fileout,overlap_size,obuf); 315 315 } 316 316 frames++; … … 318 318 319 319 debug("Processed %d frames of %d samples.\n", frames, buffer_size); 320 del_ file(file);320 del_aubio_sndfile(file); 321 321 322 322 if (output_filename != NULL) 323 del_ file(fileout);323 del_aubio_sndfile(fileout); 324 324 325 325 } -
examples/utils.h
r28d8c4a r5e9c68a 76 76 77 77 78 extern aubio_ file_t * file;79 extern aubio_ file_t * fileout;78 extern aubio_sndfile_t * file; 79 extern aubio_sndfile_t * fileout; 80 80 81 81 extern aubio_pvoc_t * pv;
Note: See TracChangeset
for help on using the changeset viewer.