Changeset 5e9c68a for ext


Ignore:
Timestamp:
Aug 9, 2005, 7:56:21 PM (19 years ago)
Author:
Paul Brossier <piem@altern.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:
a29ad46
Parents:
28d8c4a
Message:

rename file_ to aubio_sndfile, protect aubio_pitdetection_{mode,type} enumerators

Location:
ext
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • ext/sndfileio.c

    r28d8c4a r5e9c68a  
    3030#define MAX_SIZE 4096
    3131
    32 struct _aubio_file_t {
     32struct _aubio_sndfile_t {
    3333        SNDFILE *handle;
    3434        int samplerate;
     
    3939};
    4040
    41 aubio_file_t * new_file_ro(const char* outputname) {
    42         aubio_file_t * f = AUBIO_NEW(aubio_file_t);
     41aubio_sndfile_t * new_aubio_sndfile_ro(const char* outputname) {
     42        aubio_sndfile_t * f = AUBIO_NEW(aubio_sndfile_t);
    4343        SF_INFO sfinfo;
    4444        AUBIO_MEMSET(&sfinfo, 0, sizeof (sfinfo));
     
    6565}
    6666
    67 int file_open_wo(aubio_file_t * f, const char* inputname) {
     67int aubio_sndfile_open_wo(aubio_sndfile_t * f, const char* inputname) {
    6868        SF_INFO sfinfo;
    6969        memset (&sfinfo, 0, sizeof (sfinfo));
     
    9090
    9191/* setup file struct from existing one */
    92 aubio_file_t * new_file_wo(aubio_file_t * fmodel, const char *outputname) {
    93         aubio_file_t * f = AUBIO_NEW(aubio_file_t);
     92aubio_sndfile_t * new_aubio_sndfile_wo(aubio_sndfile_t * fmodel, const char *outputname) {
     93        aubio_sndfile_t * f = AUBIO_NEW(aubio_sndfile_t);
    9494        f->samplerate    = fmodel->samplerate;
    9595        f->channels      = fmodel->channels;
    9696        f->format        = fmodel->format;
    97         file_open_wo(f, outputname);
     97        aubio_sndfile_open_wo(f, outputname);
    9898        return f;
    9999}
     
    101101
    102102/* return 0 if properly closed, 1 otherwise */
    103 int del_file(aubio_file_t * f) {
     103int del_aubio_sndfile(aubio_sndfile_t * f) {
    104104        if (sf_close(f->handle)) {
    105105                AUBIO_ERR("Error closing file.");
     
    122122/* read frames from file in data
    123123 *  return the number of frames actually read */
    124 int file_read(aubio_file_t * f, int frames, fvec_t * read) {
     124int aubio_sndfile_read(aubio_sndfile_t * f, int frames, fvec_t * read) {
    125125        sf_count_t read_frames;
    126126        int i,j, channels = f->channels;
     
    131131        /* allocate data for de/interleaving reallocated when needed. */
    132132        if (nsamples >= f->size) {
    133                 AUBIO_ERR("Maximum file_read buffer size exceeded.");
     133                AUBIO_ERR("Maximum aubio_sndfile_read buffer size exceeded.");
    134134                return -1;
    135135                /*
     
    158158 *   return the number of frames actually written
    159159 */
    160 int file_write(aubio_file_t * f, int frames, fvec_t * write) {
     160int aubio_sndfile_write(aubio_sndfile_t * f, int frames, fvec_t * write) {
    161161        sf_count_t written_frames = 0;
    162162        int i, j,       channels = f->channels;
     
    166166        /* allocate data for de/interleaving reallocated when needed. */
    167167        if (nsamples >= f->size) {
    168                 AUBIO_ERR("Maximum file_write buffer size exceeded.");
     168                AUBIO_ERR("Maximum aubio_sndfile_write buffer size exceeded.");
    169169                return -1;
    170170                /*
     
    192192 */
    193193
    194 uint_t aubio_file_channels(aubio_file_t * f) {
     194uint_t aubio_sndfile_channels(aubio_sndfile_t * f) {
    195195        return f->channels;
    196196}
    197197
    198 uint_t aubio_file_samplerate(aubio_file_t * f) {
     198uint_t aubio_sndfile_samplerate(aubio_sndfile_t * f) {
    199199        return f->samplerate;
    200200}
    201201
    202 void file_info(aubio_file_t * f) {
     202void aubio_sndfile_info(aubio_sndfile_t * f) {
    203203        AUBIO_DBG("srate    : %d\n", f->samplerate);
    204204        AUBIO_DBG("channels : %d\n", f->channels);
  • ext/sndfileio.h

    r28d8c4a r5e9c68a  
    3131 * sndfile object
    3232 */
    33 typedef struct _aubio_file_t aubio_file_t;
     33typedef struct _aubio_sndfile_t aubio_sndfile_t;
    3434/**
    3535 * Open a sound file for reading
    3636 */
    37 aubio_file_t * new_file_ro (const char * inputfile);
     37aubio_sndfile_t * new_aubio_sndfile_ro (const char * inputfile);
    3838/**
    3939 * Copy file model from previously opened sound file.
    4040 */
    41 aubio_file_t * new_file_wo(aubio_file_t * existingfile, const char * outputname);
     41aubio_sndfile_t * new_aubio_sndfile_wo(aubio_sndfile_t * existingfile, const char * outputname);
    4242/**
    4343 * Open a sound file for writing
    4444 */
    45 int file_open_wo (aubio_file_t * file, const char * outputname);
     45int aubio_sndfile_open_wo (aubio_sndfile_t * file, const char * outputname);
    4646/**
    4747 * Read frames data from file
    4848 */
    49 int file_read(aubio_file_t * file, int frames, fvec_t * read);
     49int aubio_sndfile_read(aubio_sndfile_t * file, int frames, fvec_t * read);
    5050/**
    5151 * Write data of length frames to file
    5252 */
    53 int file_write(aubio_file_t * file, int frames, fvec_t * write);
     53int aubio_sndfile_write(aubio_sndfile_t * file, int frames, fvec_t * write);
    5454/**
    5555 * Close file and delete file object
    5656 */
    57 int del_file(aubio_file_t * file);
     57int del_aubio_sndfile(aubio_sndfile_t * file);
    5858/**
    5959 * Return some files facts
    6060 */
    61 void file_info(aubio_file_t * file);
     61void aubio_sndfile_info(aubio_sndfile_t * file);
    6262/**
    6363 * Return number of channel in file
    6464 */
    65 uint_t aubio_file_channels(aubio_file_t * file);
    66 uint_t aubio_file_samplerate(aubio_file_t * file);
     65uint_t aubio_sndfile_channels(aubio_sndfile_t * file);
     66uint_t aubio_sndfile_samplerate(aubio_sndfile_t * file);
    6767
    6868#ifdef __cplusplus
Note: See TracChangeset for help on using the changeset viewer.