/external/pydirac225/source/Dirac_LE.h

http://echo-nest-remix.googlecode.com/ · C Header · 35 lines · 11 code · 5 blank · 19 comment · 0 complexity · 26aa18fb6efdb6f9e83675aaf54b6377 MD5 · raw file

  1. /*
  2. * Dirac_LE.h
  3. * Dirac_LE_Lib
  4. *
  5. * Created by Tristan Jehan on 4/15/10.
  6. * Copyright 2010 The Echo Nest. All rights reserved.
  7. *
  8. * IMPORTANT: This file and its contents are subject to the terms set forth in the
  9. * "License Agreement.txt" file that accompanies this distribution.
  10. *
  11. * Copyright Š 2005-2010 Stephan M. Bernsee, http://www.dspdimension.com. All Rights Reserved
  12. */
  13. #include "Dirac.h"
  14. typedef unsigned int uint;
  15. #define TIME 1.0f
  16. #define QUALITY 0 // 0=decent/fast, 1=good/slow, 2=best/very_slow
  17. // Utilities
  18. float limiter(float val);
  19. float **allocateAudioBuffer(uint numChannels, uint numFrames);
  20. void deallocateAudioBuffer(float **samples, uint numChannels);
  21. void interlace(float *out, float **in, uint numFrames, uint numChannels);
  22. void deinterlace(float **out, float *in, uint numFrames, uint numChannels);
  23. // This function time-stretches 'inDuration' seconds to a buffer of 'outDuration' seconds.
  24. // It takes 'numChannels' from audio buffer 'inSamples' and writes the result into pre-allocated audio buffer 'outSamples'.
  25. // 'quality' is an integer from 0 (lowest quality / fast processing) to 2 (highest quality / slow processing)
  26. // returns 0 if everything went well and a negative eror number in case of a problem.
  27. int time_scale(float **outSamples, double outDuration, float **inSamples, double inDuration, long numChannels, float sampleRate, uint quality=QUALITY);
  28. // Same as above but with lists of times and durations as an input and durations as an output.
  29. // We don't allow pitch-shifting in the case of a list because of unavoidable artifacts with the limitations of dirac LE.
  30. int time_scale_list(float **outSamples, double *outDurations, float **inSamples, double *inDurations, uint numChunks, long numChannels, float sampleRate, uint quality=QUALITY);