60 #define SONIC_MIN_PITCH 65 61 #define SONIC_MAX_PITCH 400 64 #define SONIC_AMDF_FREQ 4000 159 #ifdef SONIC_SPECTROGRAM 178 #define SONIC_MAX_SPECTRUM_FREQ 5000 180 struct sonicSpectrogramStruct;
181 struct sonicBitmapStruct;
182 typedef struct sonicSpectrogramStruct* sonicSpectrogram;
183 typedef struct sonicBitmapStruct* sonicBitmap;
188 struct sonicBitmapStruct {
194 typedef struct sonicBitmapStruct* sonicBitmap;
200 sonicSpectrogram sonicGetSpectrogram(
sonicStream stream);
204 sonicSpectrogram sonicCreateSpectrogram(
int sampleRate);
208 void sonicDestroySpectrogram(sonicSpectrogram spectrogram);
211 sonicBitmap sonicConvertSpectrogramToBitmap(sonicSpectrogram spectrogram,
212 int numRows,
int numCols);
215 void sonicDestroyBitmap(sonicBitmap bitmap);
217 int sonicWritePGM(sonicBitmap bitmap,
char* fileName);
222 void sonicAddPitchPeriodToSpectrogram(sonicSpectrogram spectrogram,
223 short* samples,
int period,
void sonicSetChordPitch(sonicStream stream, int useChordPitch)
Definition: sonic.c:226
int sonicWriteUnsignedCharToStream(sonicStream stream, unsigned char *samples, int numSamples)
Definition: sonic.c:1151
int sonicSamplesAvailable(sonicStream stream)
Definition: sonic.c:613
float sonicGetRate(sonicStream stream)
Definition: sonic.c:211
float speed
Definition: sonic.c:141
void sonicSetVolume(sonicStream stream, float volume)
Definition: sonic.c:243
void sonicSetSpeed(sonicStream stream, float speed)
Definition: sonic.c:202
int sonicReadShortFromStream(sonicStream stream, short *samples, int maxSamples)
Definition: sonic.c:526
sonicStream sonicCreateStream(int sampleRate, int numChannels)
Definition: sonic.c:320
int sonicReadUnsignedCharFromStream(sonicStream stream, unsigned char *samples, int maxSamples)
Definition: sonic.c:551
int sampleRate
Definition: sonic.c:160
int sonicSetSampleRate(sonicStream stream, int sampleRate)
Definition: sonic.c:346
void sonicCleanStream(sonicStream stream)
Definition: sonic.c:362
float volume
Definition: sonic.c:142
int sonicChangeFloatSpeed(float *samples, int numSamples, float speed, float pitch, float rate, float volume, int useChordPitch, int sampleRate, int numChannels)
Definition: sonic.c:1161
int sonicFlushStream(sonicStream stream)
Definition: sonic.c:582
int sonicReadFloatFromStream(sonicStream stream, float *samples, int maxSamples)
Definition: sonic.c:496
int sonicSetNumChannels(sonicStream stream, int numChannels)
Definition: sonic.c:356
int sonicChangeShortSpeed(short *samples, int numSamples, float speed, float pitch, float rate, float volume, int useChordPitch, int sampleRate, int numChannels)
Definition: sonic.c:1181
void sonicSetQuality(sonicStream stream, int quality)
Definition: sonic.c:235
float sonicGetPitch(sonicStream stream)
Definition: sonic.c:205
int sonicGetNumChannels(sonicStream stream)
Definition: sonic.c:352
void sonicSetPitch(sonicStream stream, float pitch)
Definition: sonic.c:208
int quality
Definition: sonic.c:148
int sonicGetChordPitch(sonicStream stream)
Definition: sonic.c:223
float pitch
Definition: sonic.c:143
void sonicSetRate(sonicStream stream, float rate)
Definition: sonic.c:215
float sonicGetVolume(sonicStream stream)
Definition: sonic.c:240
int sonicWriteShortToStream(sonicStream stream, short *samples, int numSamples)
Definition: sonic.c:1141
int useChordPitch
Definition: sonic.c:147
float rate
Definition: sonic.c:144
float sonicGetSpeed(sonicStream stream)
Definition: sonic.c:199
void sonicDestroyStream(sonicStream stream)
Definition: sonic.c:264
int sonicGetQuality(sonicStream stream)
Definition: sonic.c:231
struct sonicStreamStruct * sonicStream
Definition: sonic.h:67
int sonicWriteFloatToStream(sonicStream stream, float *samples, int numSamples)
Definition: sonic.c:1131
int sonicGetSampleRate(sonicStream stream)
Definition: sonic.c:342
int numChannels
Definition: sonic.c:149