Skip to main content
made it more appropriate for googlers
Source Link
MickLH
  • 2.8k
  • 20
  • 26

Do you care ifwant the pitch changesto warp with the speed?


NoYes: Then you want time stretching.

This is simply interpolating / combining samples to generate the same overall waveform in a different number of samples. The obvious nearest neighbor approach will cause severe aliasing but technically works. To make it sound better one can use a higher order function like sinc interpolation.


YesNo: Then you want time scaling.

This is usually boiling down the sound to a procedural / time domain representation, it is an active area of research and doesn't sound perfect. The common techniques are:

  1. Phase Vocoder
  2. Time Domain Harmonic Scaling

EDIT: Your question is WAY out of scope for SDL. If you just want a library (instead of understanding what you are doing) then try SoundTouch or Rubber Band.

Do you care if the pitch changes?


No: Then you want time stretching.

This is simply interpolating / combining samples to generate the same overall waveform in a different number of samples. The obvious nearest neighbor approach will cause severe aliasing but technically works. To make it sound better one can use a higher order function like sinc interpolation.


Yes: Then you want time scaling.

This is usually boiling down the sound to a procedural / time domain representation, it is an active area of research and doesn't sound perfect. The common techniques are:

  1. Phase Vocoder
  2. Time Domain Harmonic Scaling

EDIT: Your question is WAY out of scope for SDL. If you just want a library (instead of understanding what you are doing) then try SoundTouch or Rubber Band.

Do you want the pitch to warp with the speed?


Yes: Then you want time stretching.

This is simply interpolating / combining samples to generate the same overall waveform in a different number of samples. The obvious nearest neighbor approach will cause severe aliasing but technically works. To make it sound better one can use a higher order function like sinc interpolation.


No: Then you want time scaling.

This is usually boiling down the sound to a procedural / time domain representation, it is an active area of research and doesn't sound perfect. The common techniques are:

  1. Phase Vocoder
  2. Time Domain Harmonic Scaling

EDIT: Your question is WAY out of scope for SDL. If you just want a library (instead of understanding what you are doing) then try SoundTouch or Rubber Band.

Linked to libraries and minor formatting (last few edits)
Source Link
MickLH
  • 2.8k
  • 20
  • 26

Do you care if the pitch changes?


No: Then you want time stretching.

This is simply interpolating / combining samples to generate the same overall waveform in a different number of samples. The obvious nearest neighbor approach will cause severe aliasing but technically works. To make it sound better one can use a higher order function like sinc interpolation.


Yes: Then you want time scaling.

This is usually boiling down the sound to a procedural / time domain representation, it is an active area of research and doesn't sound perfect. The common techniques are:

  1. Phase Vocoder
  2. Time Domain Harmonic Scaling

EDIT: Your question is WAY out of scope for SDL. If you just want a library (instead of understanding what you are doing) then try SoundTouch or Rubber Band.

Do you care if the pitch changes?


No: Then you want time stretching.

This is simply interpolating / combining samples to generate the same overall waveform in a different number of samples. The obvious nearest neighbor approach will cause severe aliasing but technically works. To make it sound better one can use a higher order function like sinc interpolation.


Yes: Then you want time scaling.

This is usually boiling down the sound to a procedural / time domain representation, it is an active area of research and doesn't sound perfect. The common techniques are:

  1. Phase Vocoder
  2. Time Domain Harmonic Scaling

Do you care if the pitch changes?


No: Then you want time stretching.

This is simply interpolating / combining samples to generate the same overall waveform in a different number of samples. The obvious nearest neighbor approach will cause severe aliasing but technically works. To make it sound better one can use a higher order function like sinc interpolation.


Yes: Then you want time scaling.

This is usually boiling down the sound to a procedural / time domain representation, it is an active area of research and doesn't sound perfect. The common techniques are:

  1. Phase Vocoder
  2. Time Domain Harmonic Scaling

EDIT: Your question is WAY out of scope for SDL. If you just want a library (instead of understanding what you are doing) then try SoundTouch or Rubber Band.

Source Link
MickLH
  • 2.8k
  • 20
  • 26

Do you care if the pitch changes?


No: Then you want time stretching.

This is simply interpolating / combining samples to generate the same overall waveform in a different number of samples. The obvious nearest neighbor approach will cause severe aliasing but technically works. To make it sound better one can use a higher order function like sinc interpolation.


Yes: Then you want time scaling.

This is usually boiling down the sound to a procedural / time domain representation, it is an active area of research and doesn't sound perfect. The common techniques are:

  1. Phase Vocoder
  2. Time Domain Harmonic Scaling