Changeset c6e7ba1 for src


Ignore:
Timestamp:
Apr 25, 2016, 4:42:43 PM (9 years ago)
Author:
Paul Brossier <piem@piem.org>
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:
b4e1438
Parents:
b60f297
Message:

src/io/source_sndfile.h: add _get_duration

Location:
src/io
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • src/io/source_sndfile.c

    rb60f297 rc6e7ba1  
    5454  int input_channels;
    5555  int input_format;
     56  int duration;
    5657
    5758  // resampling stuff
     
    106107  s->input_channels   = sfinfo.channels;
    107108  s->input_format     = sfinfo.format;
     109  s->duration         = sfinfo.frames;
    108110
    109111  if (samplerate == 0) {
     
    273275}
    274276
     277uint_t aubio_source_sndfile_get_duration (const aubio_source_sndfile_t * s) {
     278  if (s && s->duration) {
     279    return s->duration;
     280  }
     281  return 0;
     282}
     283
    275284uint_t aubio_source_sndfile_seek (aubio_source_sndfile_t * s, uint_t pos) {
    276285  uint_t resampled_pos = (uint_t)ROUND(pos / s->ratio);
  • src/io/source_sndfile.h

    rb60f297 rc6e7ba1  
    121121/**
    122122
     123  get the duration of source object, in frames
     124
     125  \param s source object, created with ::new_aubio_source_sndfile
     126  \return number of frames in file
     127
     128*/
     129uint_t aubio_source_sndfile_get_duration (const aubio_source_sndfile_t *s);
     130
     131/**
     132
    123133  close source
    124134
Note: See TracChangeset for help on using the changeset viewer.