Previous Up Next

15.1.8  Changing the sampling rate: resample

The resample command resamples a clip to a desired rate.

Giac does resampling by using the libsamplerate library http://www.mega-nerd.com/libsamplerate/ written by Erik de Castro Lopo. For more information see the library documentation.


Example.
Assuming that the directory sounds contains example.wav, a wav file with a sample rate of 44100:
Input:

clip:=readwav("/path/to/sounds/example.wav"):; samplerate(clip)

Output:

44100

Input:

res:=resample(clip,48000):; samplerate(res)

Output:

48000

Previous Up Next