PageRenderTime 15ms CodeModel.GetById 2ms app.highlight 8ms RepoModel.GetById 1ms app.codeStats 1ms

/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
14#include "Dirac.h"
15typedef unsigned int uint;
16
17#define TIME 1.0f
18#define QUALITY 0 // 0=decent/fast, 1=good/slow, 2=best/very_slow
19
20// Utilities
21float limiter(float val);
22float **allocateAudioBuffer(uint numChannels, uint numFrames);
23void deallocateAudioBuffer(float **samples, uint numChannels);
24void interlace(float *out, float **in, uint numFrames, uint numChannels);
25void deinterlace(float **out, float *in, uint numFrames, uint numChannels);
26
27// This function time-stretches 'inDuration' seconds to a buffer of 'outDuration' seconds.
28// It takes 'numChannels' from audio buffer 'inSamples' and writes the result into pre-allocated audio buffer 'outSamples'.
29// 'quality' is an integer from 0 (lowest quality / fast processing) to 2 (highest quality / slow processing)
30// returns 0 if everything went well and a negative eror number in case of a problem.
31int time_scale(float **outSamples, double outDuration, float **inSamples, double inDuration, long numChannels, float sampleRate, uint quality=QUALITY);
32
33// Same as above but with lists of times and durations as an input and durations as an output.
34// We don't allow pitch-shifting in the case of a list because of unavoidable artifacts with the limitations of dirac LE.
35int time_scale_list(float **outSamples, double *outDurations, float **inSamples, double *inDurations, uint numChunks, long numChannels, float sampleRate, uint quality=QUALITY);