Class AudioQuantize
- All Implemented Interfaces:
Proxy
-
Constructor Summary
ConstructorDescriptionAudioQuantize
(MemorySegment address) Create a AudioQuantize proxy instance for the provided memory address. -
Method Summary
Modifier and TypeMethodDescriptionvoid
free()
Free aGstAudioQuantize
.static AudioQuantize
new_
(AudioDitherMethod dither, AudioNoiseShapingMethod ns, Set<AudioQuantizeFlags> flags, AudioFormat format, int channels, int quantizer) Create a new quantizer object with the given parameters.static AudioQuantize
new_
(AudioDitherMethod dither, AudioNoiseShapingMethod ns, AudioQuantizeFlags flags, AudioFormat format, int channels, int quantizer) Create a new quantizer object with the given parameters.void
reset()
Reset this AudioQuantize to the state is was when created, clearing any history it might have.void
samples
(@Nullable MemorySegment in, @Nullable MemorySegment out, int samples) Perform quantization onsamples
inin
and write the result toout
.Methods inherited from class io.github.jwharm.javagi.base.ProxyInstance
equals, handle, hashCode
-
Constructor Details
-
AudioQuantize
Create a AudioQuantize proxy instance for the provided memory address.- Parameters:
address
- the memory address of the native object
-
-
Method Details
-
new_
public static AudioQuantize new_(AudioDitherMethod dither, AudioNoiseShapingMethod ns, Set<AudioQuantizeFlags> flags, AudioFormat format, int channels, int quantizer) Create a new quantizer object with the given parameters.Output samples will be quantized to a multiple of
quantizer
. Better performance is achieved whenquantizer
is a power of 2.Dithering and noise-shaping can be performed during quantization with the
dither
andns
parameters.- Parameters:
dither
- aGstAudioDitherMethod
ns
- aGstAudioNoiseShapingMethod
flags
-GstAudioQuantizeFlags
format
- theGstAudioFormat
of the sampleschannels
- the amount of channels in the samplesquantizer
- the quantizer to use- Returns:
- a new
GstAudioQuantize
. Free with gst_audio_quantize_free().
-
new_
public static AudioQuantize new_(AudioDitherMethod dither, AudioNoiseShapingMethod ns, AudioQuantizeFlags flags, AudioFormat format, int channels, int quantizer) Create a new quantizer object with the given parameters.Output samples will be quantized to a multiple of
quantizer
. Better performance is achieved whenquantizer
is a power of 2.Dithering and noise-shaping can be performed during quantization with the
dither
andns
parameters.- Parameters:
dither
- aGstAudioDitherMethod
ns
- aGstAudioNoiseShapingMethod
flags
-GstAudioQuantizeFlags
format
- theGstAudioFormat
of the sampleschannels
- the amount of channels in the samplesquantizer
- the quantizer to use- Returns:
- a new
GstAudioQuantize
. Free with gst_audio_quantize_free().
-
free
public void free()Free aGstAudioQuantize
. -
reset
public void reset()Reset this AudioQuantize to the state is was when created, clearing any history it might have. -
samples
public void samples(@Nullable @Nullable MemorySegment in, @Nullable @Nullable MemorySegment out, int samples) Perform quantization onsamples
inin
and write the result toout
.In case the samples are interleaved,
in
andout
must point to an array with a single element pointing to a block of interleaved samples.If non-interleaved samples are used,
in
andout
must point to an array with pointers to memory blocks, one for each channel.in
andout
may point to the same memory location, in which case samples will be modified in-place.- Parameters:
in
- input samplesout
- output samplessamples
- number of samples
-