|
Blender V5.3
|
#include <BKE_sound_sample.hh>
Classes | |
| struct | Key |
| struct | WindowWeights |
Public Types | |
| enum class | WindowFunction { Hann , Hamming , Blackman , Rectangular } |
| enum class | InterpolationMethod { Linear , CatmullRom , BSpline } |
Public Member Functions | |
| float | sample (float time, float low, float high, InterpolationMethod time_interpolation, InterpolationMethod frequency_interpolation) const |
Static Public Member Functions | |
| static std::shared_ptr< const bSoundFrequencySampler > | get_cached (const bSound &sound, const Key &key) |
This class allows efficiently sampling an arbitrary frequency range at an arbitrary point in time. This is achieved by caching the result of the fourier transform for various windows and interpolating between the cached values.
Used by the Sample Sound node in Geometry Nodes.
Definition at line 33 of file BKE_sound_sample.hh.
|
strong |
Definition at line 47 of file BKE_sound_sample.hh.
|
strong |
Window function that is applied before computing the FFT. It avoids spectral leakage and generally leads to better results. Using #Rectangular mode is the same as not using any window function.
| Enumerator | |
|---|---|
| Hann | |
| Hamming | |
| Blackman | |
| Rectangular | |
Definition at line 40 of file BKE_sound_sample.hh.
|
static |
Access a reusable frequency sampler for the given sound.
Definition at line 2190 of file blenkernel/intern/sound.cc.
References blender::bke::bSoundFrequencySampler::Key::channel, blender::SoundInfo::specs, and UNUSED_VARS.
Referenced by blender::nodes::node_geo_sample_sound_frequencies_cc::SampleSoundFunction::call().
| float blender::bke::bSoundFrequencySampler::sample | ( | float | time, |
| float | low, | ||
| float | high, | ||
| InterpolationMethod | time_interpolation, | ||
| InterpolationMethod | frequency_interpolation ) const |
Sample the amplitude a the given time and frequency range.
Definition at line 2421 of file blenkernel/intern/sound.cc.
References BSpline, blender::bke::bspline_interpolation(), blender::bke::catmul_rom_interpolation(), CatmullRom, floorf, blender::fractf(), blender::math::interpolate(), and Linear.