fmod/core/enums.rs
1// Copyright (c) 2024 Melody Madeline Lyons
2//
3// This Source Code Form is subject to the terms of the Mozilla Public
4// License, v. 2.0. If a copy of the MPL was not distributed with this
5// file, You can obtain one at https://mozilla.org/MPL/2.0/.
6
7use crate::{Error, Result};
8use fmod_sys::*;
9
10#[cfg(doc)]
11use crate::{Channel, ChannelControl, Dsp, Geometry, Sound, System, SystemBuilder, studio};
12
13/// Speaker mode types.
14///
15/// Note below the phrase 'sound channels' is used. These are the subchannels inside a sound, they are not related and have nothing to do with the FMOD class "Channel".
16///
17/// For example a mono sound has 1 sound channel, a stereo sound has 2 sound channels, and an AC3 or 6 channel wav file have 6 "sound channels".
18///
19/// [`FMOD_SPEAKERMODE_RAW`]
20/// This mode is for output devices that are not specifically mono/stereo/quad/surround/5.1 or 7.1, but are multi-channel.
21/// - Use [`SystemBuilder::software_format`] to specify the number of speakers you want to address, otherwise it will default to 2 (stereo).
22/// - Sound channels map to speakers sequentially, so a mono sound maps to output speaker 0, stereo sound maps to output speaker 0 & 1.
23/// - The user assumes knowledge of the speaker order. [`Speaker`] enumerations may not apply, so raw channel indices should be used.
24/// - Multi-channel sounds map input channels to output channels 1:1.
25/// - Speaker levels must be manually set with [`ChannelControl::set_mix_matrix`].
26/// - [`ChannelControl::set_pan`] and [`ChannelControl::set_mix_levels_output`] do not work.
27///
28/// [`FMOD_SPEAKERMODE_MONO`]
29/// This mode is for a 1 speaker arrangement.
30///
31/// - Panning does not work in this speaker mode.
32/// - Mono, stereo and multi-channel sounds have each sound channel played on the one speaker at unity.
33/// - Mix behavior for multi-channel sounds can be set with [`ChannelControl::set_mix_matrix`].
34///
35/// [`FMOD_SPEAKERMODE_STEREO`]
36/// This mode is for 2 speaker arrangements that have a left and right speaker.
37///
38/// - Mono sounds default to an even distribution between left and right. They can be panned with [`ChannelControl::set_pan`].
39/// - Stereo sounds default to the middle, or full left in the left speaker and full right in the right speaker.
40/// They can be cross faded with [`ChannelControl::set_pan`].
41/// - Multi-channel sounds have each sound channel played on each speaker at unity.
42/// - Mix behavior for multi-channel sounds can be set with [`ChannelControl::set_mix_matrix`].
43///
44/// [`FMOD_SPEAKERMODE_QUAD`]
45/// This mode is for 4 speaker arrangements that have a front left, front right, surround left and a surround right speaker.
46///
47/// - Mono sounds default to an even distribution between front left and front right. They can be panned with [`ChannelControl::set_pan`].
48/// - Stereo sounds default to the left sound channel played on the front left, and the right sound channel played on the front right.
49/// They can be cross faded with [`ChannelControl::set_pan`].
50/// - Multi-channel sounds default to all of their sound channels being played on each speaker in order of input.
51/// - Mix behavior for multi-channel sounds can be set with [`ChannelControl::set_mix_matrix`].
52///
53/// [`FMOD_SPEAKERMODE_SURROUND`]
54/// This mode is for 5 speaker arrangements that have a left/right/center/surround left/surround right.
55///
56/// - Mono sounds default to the center speaker. They can be panned with [`ChannelControl::set_pan`].
57/// - Stereo sounds default to the left sound channel played on the front left, and the right sound channel played on the front right.
58/// They can be cross faded with [`ChannelControl::set_pan`].
59/// - Multi-channel sounds default to all of their sound channels being played on each speaker in order of input.
60/// - Mix behavior for multi-channel sounds can be set with [`ChannelControl::set_mix_matrix`].
61///
62/// [`FMOD_SPEAKERMODE_5POINT1`]
63/// This mode is for 5.1 speaker arrangements that have a left/right/center/surround left/surround right and a subwoofer speaker.
64///
65/// - Mono sounds default to the center speaker. They can be panned with [`ChannelControl::set_pan`].
66/// - Stereo sounds default to the left sound channel played on the front left, and the right sound channel played on the front right.
67/// They can be cross faded with [`ChannelControl::set_pan`].
68/// - Multi-channel sounds default to all of their sound channels being played on each speaker in order of input.
69/// - Mix behavior for multi-channel sounds can be set with [`ChannelControl::set_mix_matrix`].
70///
71/// [`FMOD_SPEAKERMODE_7POINT1`]
72/// This mode is for 7.1 speaker arrangements that have a left/right/center/surround left/surround right/rear left/rear right and a subwoofer speaker.
73///
74/// - Mono sounds default to the center speaker. They can be panned with [`ChannelControl::set_pan`].
75/// - Stereo sounds default to the left sound channel played on the front left, and the right sound channel played on the front right.
76/// They can be cross faded with [`ChannelControl::set_pan`].
77/// - Multi-channel sounds default to all of their sound channels being played on each speaker in order of input.
78/// - Mix behavior for multi-channel sounds can be set with [`ChannelControl::set_mix_matrix`].
79///
80/// See the FMOD Studio Mixing Guide for graphical depictions of each speaker mode.
81#[derive(Debug, Clone, Copy, PartialEq, Eq)]
82#[derive(
83 num_enum::TryFromPrimitive,
84 num_enum::IntoPrimitive,
85 num_enum::UnsafeFromPrimitive
86)]
87// stupid enum repr hack
88#[cfg_attr(target_env = "msvc", repr(i32))]
89#[cfg_attr(not(target_env = "msvc"), repr(u32))]
90pub enum SpeakerMode {
91 /// Default speaker mode for the chosen output mode which will resolve after [`SystemBuilder::build`].
92 Default = FMOD_SPEAKERMODE_DEFAULT,
93 /// Assume there is no special mapping from a given channel to a speaker, channels map 1:1 in order.
94 ///
95 /// Use [`SystemBuilder::software_format`] to specify the speaker count.
96 Raw = FMOD_SPEAKERMODE_RAW,
97 /// 1 speaker setup (monaural).
98 Mono = FMOD_SPEAKERMODE_MONO,
99 /// 2 speaker setup (stereo) front left, front right.
100 Stereo = FMOD_SPEAKERMODE_STEREO,
101 /// 4 speaker setup (4.0) front left, front right, surround left, surround right.
102 Quad = FMOD_SPEAKERMODE_QUAD,
103 /// 5 speaker setup (5.0) front left, front right, center, surround left, surround right.
104 Surround = FMOD_SPEAKERMODE_SURROUND,
105 /// 6 speaker setup (5.1) front left, front right, center, low frequency, surround left, surround right.
106 FivePointOne = FMOD_SPEAKERMODE_5POINT1,
107 /// 8 speaker setup (7.1) front left, front right, center, low frequency, surround left, surround right, back left, back right.
108 SevenPointOne = FMOD_SPEAKERMODE_7POINT1,
109 /// 12 speaker setup (7.1.4) front left, front right, center, low frequency, surround left, surround right, back left, back right, top front left, top front right, top back left, top back right.
110 SevenPointOneFour = FMOD_SPEAKERMODE_7POINT1POINT4,
111}
112
113/// Built-in output types that can be used to run the mixer.
114#[derive(Debug, Clone, Copy, PartialEq, Eq)]
115#[derive(
116 num_enum::TryFromPrimitive,
117 num_enum::IntoPrimitive,
118 num_enum::UnsafeFromPrimitive
119)]
120// stupid enum repr hack
121#[cfg_attr(target_env = "msvc", repr(i32))]
122#[cfg_attr(not(target_env = "msvc"), repr(u32))]
123pub enum OutputType {
124 /// Picks the best output mode for the platform. This is the default.
125 AutoDetect = FMOD_OUTPUTTYPE_AUTODETECT,
126 /// All - 3rd party plug-in, unknown.
127 /// This is for use with [`System::get_output_type`] only.
128 Unknown = FMOD_OUTPUTTYPE_UNKNOWN,
129 /// All - Perform all mixing but discard the final output.
130 NoSound = FMOD_OUTPUTTYPE_NOSOUND,
131 /// All - Writes output to a .wav file.
132 WavWriter = FMOD_OUTPUTTYPE_WAVWRITER,
133 /// All - Non-realtime version of [`FMOD_OUTPUTTYPE_NOSOUND`], one mix per [`System::update`].
134 NoSoundNRT = FMOD_OUTPUTTYPE_NOSOUND_NRT,
135 /// All - Non-realtime version of [`FMOD_OUTPUTTYPE_WAVWRITER`], one mix per [`System::update`].
136 WavWriterNRT = FMOD_OUTPUTTYPE_WAVWRITER_NRT,
137 /// Win / UWP / Xbox One / Game Core - Windows Audio Session API.
138 ///
139 /// (Default on Windows, Xbox One, Game Core and UWP)
140 WASAPI = FMOD_OUTPUTTYPE_WASAPI,
141 /// Win - Low latency ASIO 2.0.
142 ASIO = FMOD_OUTPUTTYPE_ASIO,
143 /// Linux - Pulse Audio.
144 ///
145 /// (Default on Linux if available)
146 PulseAudio = FMOD_OUTPUTTYPE_PULSEAUDIO,
147 /// Linux - Advanced Linux Sound Architecture.
148 ///
149 /// (Default on Linux if `PulseAudio` isn't available)
150 Alsa = FMOD_OUTPUTTYPE_ALSA,
151 /// Mac / iOS - Core Audio. (Default on Mac and iOS)
152 CoreAudio = FMOD_OUTPUTTYPE_COREAUDIO,
153 /// Android - Java Audio Track.
154 ///
155 /// (Default on Android 2.2 and below)
156 AudioTrack = FMOD_OUTPUTTYPE_AUDIOTRACK,
157 /// Android - `OpenSL` ES.
158 ///
159 /// (Default on Android 2.3 up to 7.1)
160 OpenSL = FMOD_OUTPUTTYPE_OPENSL,
161 /// PS4 / PS5 - Audio Out.
162 ///
163 /// (Default on PS4, PS5)
164 AudioOut = FMOD_OUTPUTTYPE_AUDIOOUT,
165 /// PS4 - `Audio3D`.
166 Audio3D = FMOD_OUTPUTTYPE_AUDIO3D,
167 /// HTML5 - Web Audio `ScriptProcessorNode` output.
168 ///
169 /// (Default on HTML5 if `AudioWorkletNode` isn't available)
170 WebAudio = FMOD_OUTPUTTYPE_WEBAUDIO,
171 /// Switch - `nn::audio`.
172 ///
173 /// (Default on Switch)
174 NNAudio = FMOD_OUTPUTTYPE_NNAUDIO,
175 /// Win10 / Xbox One / Game Core - Windows Sonic.
176 WinSonic = FMOD_OUTPUTTYPE_WINSONIC,
177 /// Android - `AAudio`.
178 ///
179 /// (Default on Android 8.1 and above)
180 AAudio = FMOD_OUTPUTTYPE_AAUDIO,
181 /// HTML5 - Web Audio `AudioWorkletNode` output.
182 ///
183 /// (Default on HTML5 if available)
184 AudioWorklet = FMOD_OUTPUTTYPE_AUDIOWORKLET,
185 /// iOS - PHASE framework.
186 ///
187 /// (Disabled)
188 Phase = FMOD_OUTPUTTYPE_PHASE,
189 /// `OpenHarmony` - `OHAudio`.
190 OHAudio = FMOD_OUTPUTTYPE_OHAUDIO,
191}
192
193/// Named constants for threads created at runtime.
194#[derive(Debug, Clone, Copy, PartialEq, Eq)]
195#[derive(
196 num_enum::TryFromPrimitive,
197 num_enum::IntoPrimitive,
198 num_enum::UnsafeFromPrimitive
199)]
200// stupid enum repr hack
201#[cfg_attr(target_env = "msvc", repr(i32))]
202#[cfg_attr(not(target_env = "msvc"), repr(u32))]
203pub enum ThreadType {
204 /// Thread responsible for mixing and processing blocks of audio.
205 Mixer = FMOD_THREAD_TYPE_MIXER,
206 /// Thread used by some output plug-ins for transferring buffered audio from [`FMOD_THREAD_TYPE_MIXER`] to the sound output device.
207 Feeder = FMOD_THREAD_TYPE_FEEDER,
208 /// Thread that decodes compressed audio to PCM for Sounds created as [`FMOD_CREATESTREAM`].
209 Stream = FMOD_THREAD_TYPE_STREAM,
210 /// Thread that reads compressed audio from disk to be consumed by [`FMOD_THREAD_TYPE_STREAM`].
211 File = FMOD_THREAD_TYPE_FILE,
212 /// Thread that processes the creation of Sounds asynchronously when opened with [`FMOD_NONBLOCKING`].
213 NonBlocking = FMOD_THREAD_TYPE_NONBLOCKING,
214 /// Thread used by some output plug-ins for transferring audio from a microphone to [`FMOD_THREAD_TYPE_MIXER`].
215 Record = FMOD_THREAD_TYPE_RECORD,
216 /// Thread used by the [`Geometry`] system for performing background calculations.
217 Geometry = FMOD_THREAD_TYPE_GEOMETRY,
218 /// Thread for network communication when using [`FMOD_INIT_PROFILE_ENABLE`].
219 Profiler = FMOD_THREAD_TYPE_PROFILER,
220 /// Thread for processing Studio API commands and scheduling sound playback.
221 StudioUpdate = FMOD_THREAD_TYPE_STUDIO_UPDATE,
222 /// Thread for asynchronously loading [`studio::Bank`] metadata.
223 StudioLoadBank = FMOD_THREAD_TYPE_STUDIO_LOAD_BANK,
224 /// Thread for asynchronously loading [`studio::Bank`] sample data.
225 StudioLoadSample = FMOD_THREAD_TYPE_STUDIO_LOAD_SAMPLE,
226 /// Thread for processing medium size delay lines for [`FMOD_DSP_TYPE_CONVOLUTIONREVERB`].
227 Convolution1 = FMOD_THREAD_TYPE_CONVOLUTION1,
228 /// Thread for processing larger size delay lines for [`FMOD_DSP_TYPE_CONVOLUTIONREVERB`].
229 Convolution2 = FMOD_THREAD_TYPE_CONVOLUTION2,
230}
231
232/// Time types used for position or length.
233#[derive(Debug, Clone, Copy, PartialEq, Eq)]
234#[derive(
235 num_enum::TryFromPrimitive,
236 num_enum::IntoPrimitive,
237 num_enum::UnsafeFromPrimitive
238)]
239#[repr(u32)]
240pub enum TimeUnit {
241 /// Milliseconds.
242 MS = FMOD_TIMEUNIT_MS,
243 /// PCM samples, related to milliseconds * samplerate / 1000.
244 PCM = FMOD_TIMEUNIT_PCM,
245 /// Bytes, related to PCM samples * channels * datawidth (ie 16bit = 2 bytes).
246 PCMBytes = FMOD_TIMEUNIT_PCMBYTES,
247 /// Raw file bytes of (compressed) sound data (does not include headers).
248 ///
249 /// Only used by [`Sound::get_length`] and [`Channel::get_position`].
250 RawBytes = FMOD_TIMEUNIT_RAWBYTES,
251 /// Fractions of 1 PCM sample. Unsigned int range 0 to `0xFFFFFFFF`.
252 ///
253 /// Used for sub-sample granularity for DSP purposes.
254 PCMFraction = FMOD_TIMEUNIT_PCMFRACTION,
255 /// MOD/S3M/XM/IT. Order in a sequenced module format.
256 ///
257 /// Use [`Sound::get_format`] to determine the PCM format being decoded to.
258 ModOrder = FMOD_TIMEUNIT_MODORDER,
259 /// MOD/S3M/XM/IT. Current row in a sequenced module format.
260 ///
261 /// Cannot use with [`Channel::set_position`].
262 /// [`Sound::get_length`] will return the number of rows in the currently playing or seeked to pattern.
263 ModRow = FMOD_TIMEUNIT_MODROW,
264 /// MOD/S3M/XM/IT. Current pattern in a sequenced module format.
265 ///
266 /// Cannot use with [`Channel::set_position`].
267 /// [`Sound::get_length`] will return the number of patterns in the song and [`Channel::get_position`] will return the currently playing pattern.
268 ModPattern = FMOD_TIMEUNIT_MODPATTERN,
269}
270
271/// Assigns an enumeration for a speaker index.
272#[derive(Debug, Clone, Copy, PartialEq, Eq)]
273#[derive(
274 num_enum::TryFromPrimitive,
275 num_enum::IntoPrimitive,
276 num_enum::UnsafeFromPrimitive
277)]
278#[repr(i32)]
279pub enum Speaker {
280 /// No speaker.
281 None = FMOD_SPEAKER_NONE,
282 /// The front right speaker
283 FrontLeft = FMOD_SPEAKER_FRONT_LEFT,
284 /// The front right speaker
285 FrontRight = FMOD_SPEAKER_FRONT_RIGHT,
286 /// The front center speaker
287 FrontCenter = FMOD_SPEAKER_FRONT_CENTER,
288 /// The LFE or 'subwoofer' speaker
289 LowFrequency = FMOD_SPEAKER_LOW_FREQUENCY,
290 /// The surround left (usually to the side) speaker
291 SurroundLeft = FMOD_SPEAKER_SURROUND_LEFT,
292 /// The surround right (usually to the side) speaker
293 SurroundRight = FMOD_SPEAKER_SURROUND_RIGHT,
294 /// The back left speaker
295 BackLeft = FMOD_SPEAKER_BACK_LEFT,
296 /// The back right speaker
297 BackRight = FMOD_SPEAKER_BACK_RIGHT,
298 /// The top front left speaker
299 TopFrontLeft = FMOD_SPEAKER_TOP_FRONT_LEFT,
300 /// The top front right speaker
301 TopFrontRight = FMOD_SPEAKER_TOP_FRONT_RIGHT,
302 /// The top back left speaker
303 TopBackLeft = FMOD_SPEAKER_TOP_BACK_LEFT,
304 /// The top back right speaker
305 TopBackRight = FMOD_SPEAKER_TOP_BACK_RIGHT,
306}
307
308/// Types of plug-in used to extend functionality.
309#[derive(Debug, Clone, Copy, PartialEq, Eq)]
310#[derive(
311 num_enum::TryFromPrimitive,
312 num_enum::IntoPrimitive,
313 num_enum::UnsafeFromPrimitive
314)]
315// stupid enum repr hack
316#[cfg_attr(target_env = "msvc", repr(i32))]
317#[cfg_attr(not(target_env = "msvc"), repr(u32))]
318pub enum PluginType {
319 /// Audio output interface plug-in represented with [`FMOD_OUTPUT_DESCRIPTION`].
320 Output = FMOD_PLUGINTYPE_OUTPUT,
321 /// File format codec plug-in represented with [`FMOD_CODEC_DESCRIPTION`].
322 Codec = FMOD_PLUGINTYPE_CODEC,
323 /// DSP unit plug-in represented with [`FMOD_DSP_DESCRIPTION`].
324 DSP = FMOD_PLUGINTYPE_DSP,
325}
326
327/// DSP types.
328#[derive(Debug, Clone, Copy, PartialEq, Eq)]
329#[derive(
330 num_enum::TryFromPrimitive,
331 num_enum::IntoPrimitive,
332 num_enum::UnsafeFromPrimitive
333)]
334// stupid enum repr hack
335#[cfg_attr(target_env = "msvc", repr(i32))]
336#[cfg_attr(not(target_env = "msvc"), repr(u32))]
337pub enum DspType {
338 /// Was created via a non-FMOD plug-in and has an unknown purpose.
339 Unknown = FMOD_DSP_TYPE_UNKNOWN,
340 /// Does not process the signal. Acts as a unit purely for mixing inputs.
341 Mixer = FMOD_DSP_TYPE_MIXER,
342 /// Generates sine/square/saw/triangle or noise tones.
343 ///
344 /// See [`FMOD_DSP_OSCILLATOR`] for parameter information.
345 Oscillator = FMOD_DSP_TYPE_OSCILLATOR,
346 /// Filters sound using a high quality, resonant lowpass filter algorithm but consumes more CPU time.
347 ///
348 /// Deprecated and will be removed in a future release.
349 /// See [`FMOD_DSP_LOWPASS`] remarks for parameter information.
350 #[deprecated]
351 Lowpass = FMOD_DSP_TYPE_LOWPASS,
352 /// Filters sound using a resonant lowpass filter algorithm that is used in Impulse Tracker,
353 /// but with limited cutoff range (0 to 8060hz).
354 ///
355 /// See [`FMOD_DSP_ITLOWPASS`] for parameter information.
356 ItLowpass = FMOD_DSP_TYPE_ITLOWPASS,
357 /// Filters sound using a resonant highpass filter algorithm.
358 ///
359 /// Deprecated and will be removed in a future release.
360 /// See [`FMOD_DSP_HIGHPASS`] remarks for parameter information.
361 #[deprecated]
362 Highpass = FMOD_DSP_TYPE_HIGHPASS,
363 /// Produces an echo on the sound and fades out at the desired rate.
364 ///
365 /// See [`FMOD_DSP_ECHO`] for parameter information.
366 Echo = FMOD_DSP_TYPE_ECHO,
367 /// Pans and scales the volume of a unit.
368 ///
369 /// See [`FMOD_DSP_FADER`] for parameter information.
370 Fader = FMOD_DSP_TYPE_FADER,
371 /// Produces a flange effect on the sound.
372 ///
373 /// See [`FMOD_DSP_FLANGE`] for parameter information.
374 Flange = FMOD_DSP_TYPE_FLANGE,
375 /// Distorts the sound.
376 ///
377 /// See [`FMOD_DSP_DISTORTION`] for parameter information.
378 Distortion = FMOD_DSP_TYPE_DISTORTION,
379 /// Normalizes or amplifies the sound to a certain level.
380 ///
381 /// See [`FMOD_DSP_NORMALIZE`] for parameter information.
382 Normalize = FMOD_DSP_TYPE_NORMALIZE,
383 /// Limits the sound to a certain level.
384 ///
385 /// See [`FMOD_DSP_LIMITER`] for parameter information.
386 Limiter = FMOD_DSP_TYPE_LIMITER,
387 /// Attenuates or amplifies a selected frequency range.
388 ///
389 /// Deprecated and will be removed in a future release.
390 /// See [`FMOD_DSP_PARAMEQ`] for parameter information.
391 #[deprecated]
392 ParamEq = FMOD_DSP_TYPE_PARAMEQ,
393 /// Bends the pitch of a sound without changing the speed of playback.
394 ///
395 /// See [`FMOD_DSP_PITCHSHIFT`] for parameter information.
396 PitchShift = FMOD_DSP_TYPE_PITCHSHIFT,
397 /// Produces a chorus effect on the sound.
398 ///
399 /// See [`FMOD_DSP_CHORUS`] for parameter information.
400 Chorus = FMOD_DSP_TYPE_CHORUS,
401 #[cfg(fmod_eq_2_2)]
402 VstPlugin = FMOD_DSP_TYPE_VSTPLUGIN,
403 #[cfg(fmod_eq_2_2)]
404 WinampPlugin = FMOD_DSP_TYPE_WINAMPPLUGIN,
405 /// Produces an echo on the sound and fades out at the desired rate as is used in Impulse Tracker.
406 ///
407 /// See [`FMOD_DSP_ITECHO`] for parameter information.
408 ItEcho = FMOD_DSP_TYPE_ITECHO,
409 /// Dynamic compression (linked/unlinked multi-channel, wideband).
410 ///
411 /// See [`FMOD_DSP_COMPRESSOR`] for parameter information.
412 Compressor = FMOD_DSP_TYPE_COMPRESSOR,
413 /// I3DL2 reverb effect.
414 ///
415 /// See [`FMOD_DSP_SFXREVERB`] for parameter information.
416 SfxReverb = FMOD_DSP_TYPE_SFXREVERB,
417 /// Filters sound using a simple lowpass with no resonance.
418 ///
419 /// Deprecated and will be removed in a future release.
420 /// See [`FMOD_DSP_LOWPASS_SIMPLE`] remarks for parameter information.
421 #[deprecated]
422 LowpassSimple = FMOD_DSP_TYPE_LOWPASS_SIMPLE,
423 /// Produces different delays on individual channels of the sound.
424 ///
425 /// See [`FMOD_DSP_DELAY`] for parameter information.
426 Delay = FMOD_DSP_TYPE_DELAY,
427 /// Produces a tremolo / chopper effect on the sound.
428 ///
429 /// See [`FMOD_DSP_TREMOLO`] for parameter information.
430 Tremolo = FMOD_DSP_TYPE_TREMOLO,
431 #[cfg(fmod_eq_2_2)]
432 LadspaPlugin = FMOD_DSP_TYPE_LADSPAPLUGIN,
433 /// Sends a copy of the signal to a return DSP anywhere in the DSP tree.
434 ///
435 /// See [`FMOD_DSP_SEND`] for parameter information.
436 Send = FMOD_DSP_TYPE_SEND,
437 /// Receives signals from a number of send DSPs.
438 ///
439 /// See [`FMOD_DSP_RETURN`] for parameter information.
440 Return = FMOD_DSP_TYPE_RETURN,
441 /// Filters sound using a simple highpass with no resonance, but has flexible cutoff and is fast.
442 ///
443 /// Deprecated and will be removed in a future release.
444 /// See [`FMOD_DSP_HIGHPASS_SIMPLE`] remarks for parameter information.
445 #[deprecated]
446 HighpassSimple = FMOD_DSP_TYPE_HIGHPASS_SIMPLE,
447 /// Pans the signal in 2D or 3D, possibly upmixing or downmixing as well.
448 ///
449 /// See [`FMOD_DSP_PAN`] for parameter information.
450 Pan = FMOD_DSP_TYPE_PAN,
451 /// Three-band equalizer.
452 ///
453 /// See [`FMOD_DSP_THREE_EQ`] for parameter information.
454 ThreeEq = FMOD_DSP_TYPE_THREE_EQ,
455 /// Analyzes the signal and provides spectrum information back through [`Dsp::get_parameter`].
456 ///
457 /// See [`FMOD_DSP_FFT`] for parameter information.
458 Fft = FMOD_DSP_TYPE_FFT,
459 /// Analyzes the loudness and true peak of the signal.
460 LoudnessMeter = FMOD_DSP_TYPE_LOUDNESS_METER,
461 #[cfg(fmod_eq_2_2)]
462 EnvelopeFollower = FMOD_DSP_TYPE_ENVELOPEFOLLOWER,
463 /// Convolution reverb.
464 ///
465 /// See [`FMOD_DSP_CONVOLUTION_REVERB`] for parameter information.
466 ConvolutionReverb = FMOD_DSP_TYPE_CONVOLUTIONREVERB,
467 /// Provides per channel gain,
468 /// channel grouping of the input signal which also sets the speaker format for the output signal,
469 /// and customizable input to output channel routing.
470 ///
471 /// See [`FMOD_DSP_CHANNELMIX`] for parameter information.
472 ChannelMix = FMOD_DSP_TYPE_CHANNELMIX,
473 /// 'sends' and 'receives' from a selection of up to 32 different slots.
474 /// It is like a send/return but it uses global slots rather than returns as the destination.
475 /// It also has other features.
476 /// Multiple transceivers can receive from a single channel,
477 /// or multiple transceivers can send to a single channel, or a combination of both.
478 ///
479 /// See [`FMOD_DSP_TRANSCEIVER`] for parameter information.
480 Transceiver = FMOD_DSP_TYPE_TRANSCEIVER,
481 /// Spatializes input signal by passing it to an external object mixer.
482 ///
483 /// See [`FMOD_DSP_OBJECTPAN`] for parameter information.
484 ObjectPan = FMOD_DSP_TYPE_OBJECTPAN,
485 /// Five band parametric equalizer.
486 ///
487 /// See [`FMOD_DSP_MULTIBAND_EQ`] for parameter information.
488 MultibandEq = FMOD_DSP_TYPE_MULTIBAND_EQ,
489 /// Three-band compressor/expander.
490 ///
491 /// See [`FMOD_DSP_MULTIBAND_DYNAMICS`] for parameter information.
492 #[cfg(fmod_eq_2_3)]
493 MultibandDynamics = FMOD_DSP_TYPE_MULTIBAND_DYNAMICS,
494}
495
496/// Port types available for routing audio.
497#[derive(Debug, Clone, Copy, PartialEq, Eq)]
498#[derive(
499 num_enum::TryFromPrimitive,
500 num_enum::IntoPrimitive,
501 num_enum::UnsafeFromPrimitive
502)]
503// stupid enum repr hack
504#[cfg_attr(target_env = "msvc", repr(i32))]
505#[cfg_attr(not(target_env = "msvc"), repr(u32))]
506pub enum PortType {
507 /// Background music, pass [`FMOD_PORT_INDEX_NONE`] as port index.
508 Music = FMOD_PORT_TYPE_MUSIC,
509 /// Copyright background music, pass [`FMOD_PORT_INDEX_NONE`] as port index.
510 CopyrightMusic = FMOD_PORT_TYPE_COPYRIGHT_MUSIC,
511 /// Voice chat, pass platform specific user ID of desired user as port index.
512 Voice = FMOD_PORT_TYPE_VOICE,
513 /// Controller speaker, pass platform specific user ID of desired user as port index.
514 Controller = FMOD_PORT_TYPE_CONTROLLER,
515 /// Personal audio device, pass platform specific user ID of desired user as port index.
516 Personal = FMOD_PORT_TYPE_PERSONAL,
517 /// Controller vibration, pass platform specific user ID of desired user as port index.
518 Vibration = FMOD_PORT_TYPE_VIBRATION,
519 /// Auxiliary output port, pass [`FMOD_PORT_INDEX_NONE`] as port index.
520 AUX = FMOD_PORT_TYPE_AUX,
521 /// Passthrough output port, pass [`FMOD_PORT_INDEX_NONE`] as port index.
522 #[cfg(fmod_eq_2_3)]
523 Passthrough = FMOD_PORT_TYPE_PASSTHROUGH,
524 /// VR Controller vibration, pass platform specific user ID of desired user as port index.
525 #[cfg(fmod_eq_2_3)]
526 VrVibration = FMOD_PORT_TYPE_VR_VIBRATION,
527}
528
529/// Values specifying behavior when a sound group's max audible value is exceeded.
530#[derive(Debug, Clone, Copy, PartialEq, Eq)]
531#[derive(
532 num_enum::TryFromPrimitive,
533 num_enum::IntoPrimitive,
534 num_enum::UnsafeFromPrimitive
535)]
536// stupid enum repr hack
537#[cfg_attr(target_env = "msvc", repr(i32))]
538#[cfg_attr(not(target_env = "msvc"), repr(u32))]
539pub enum SoundGroupBehavior {
540 /// Excess sounds will fail when calling [`System::play_sound`].
541 Fail = FMOD_SOUNDGROUP_BEHAVIOR_FAIL,
542 /// Excess sounds will begin mute and will become audible when sufficient sounds are stopped.
543 Mute = FMOD_SOUNDGROUP_BEHAVIOR_MUTE,
544 /// Excess sounds will steal from the quietest [`Sound`] playing in the group.
545 StealLowest = FMOD_SOUNDGROUP_BEHAVIOR_STEALLOWEST,
546}
547
548/// List of connection types between two DSP units.
549#[derive(Debug, Clone, Copy, PartialEq, Eq)]
550#[derive(
551 num_enum::TryFromPrimitive,
552 num_enum::IntoPrimitive,
553 num_enum::UnsafeFromPrimitive
554)]
555// stupid enum repr hack
556#[cfg_attr(target_env = "msvc", repr(i32))]
557#[cfg_attr(not(target_env = "msvc"), repr(u32))]
558pub enum DspConnectionType {
559 /// Default connection type. Audio is mixed from the input to the output DSP's audible buffer.
560 Standard = FMOD_DSPCONNECTION_TYPE_STANDARD,
561 /// Sidechain connection type. Audio is mixed from the input to the output DSP's sidechain buffer.
562 Sidechain = FMOD_DSPCONNECTION_TYPE_SIDECHAIN,
563 /// Send connection type.
564 ///
565 /// Audio is mixed from the input to the output DSP's audible buffer,
566 /// but the input is not executed, only copied from.
567 ///
568 /// A standard connection or sidechain needs to make an input execute to generate data.
569 Send = FMOD_DSPCONNECTION_TYPE_SEND,
570 /// Send sidechain connection type.
571 ///
572 /// Audio is mixed from the input to the output DSP's sidechain buffer,
573 /// but the input is not executed, only copied from.
574 ///
575 /// A standard connection or sidechain needs to make an input execute to generate data.
576 SendSidechain = FMOD_DSPCONNECTION_TYPE_SEND_SIDECHAIN,
577}
578
579/// Data parameter types.
580#[derive(Debug, Clone, Copy, PartialEq, Eq)]
581#[derive(num_enum::FromPrimitive, num_enum::IntoPrimitive)]
582#[repr(i32)]
583pub enum DspParameterDataType {
584 /// Data type for [`FMOD_DSP_PARAMETER_OVERALLGAIN`] parameters.
585 ///
586 /// There should be a maximum of one per DSP.
587 OverAlign = FMOD_DSP_PARAMETER_DATA_TYPE_OVERALLGAIN,
588 /// Data type for [`FMOD_DSP_PARAMETER_3DATTRIBUTES`] parameters.
589 ///
590 /// There should be a maximum of one per DSP.
591 Attributes3D = FMOD_DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES,
592 /// Data type for [`FMOD_DSP_PARAMETER_SIDECHAIN`] parameters.
593 ///
594 /// There should be a maximum of one per DSP.
595 Sidechain = FMOD_DSP_PARAMETER_DATA_TYPE_SIDECHAIN,
596 /// Data type for [`FMOD_DSP_PARAMETER_FFT`] parameters.
597 ///
598 /// There should be a maximum of one per DSP.
599 FFT = FMOD_DSP_PARAMETER_DATA_TYPE_FFT,
600 /// Data type for [`FMOD_DSP_PARAMETER_3DATTRIBUTES_MULTI`] parameters.
601 ///
602 /// There should be a maximum of one per DSP.
603 Attributes3DMulti = FMOD_DSP_PARAMETER_DATA_TYPE_3DATTRIBUTES_MULTI,
604 /// Data type for [`FMOD_DSP_PARAMETER_ATTENUATION_RANGE`] parameters.
605 ///
606 /// There should be a maximum of one per DSP.
607 AttenuationRange = FMOD_DSP_PARAMETER_DATA_TYPE_ATTENUATION_RANGE,
608 /// Data type for [`FMOD_DSP_PARAMETER_DYNAMIC_RESPONSE`] parameters.
609 ///
610 /// There should be a maximum of one per DSP.
611 #[cfg(fmod_2_3)]
612 DynamicResponse = FMOD_DSP_PARAMETER_DATA_TYPE_DYNAMIC_RESPONSE,
613 #[num_enum(catch_all)]
614 /// Default data type. All user data types should be 0 or above.
615 User(i32) = FMOD_DSP_PARAMETER_DATA_TYPE_USER, // unsure if this is correct
616}
617
618/// Recognized audio formats that can be loaded into a Sound.
619#[derive(Debug, Clone, Copy, PartialEq, Eq)]
620#[derive(
621 num_enum::TryFromPrimitive,
622 num_enum::IntoPrimitive,
623 num_enum::UnsafeFromPrimitive
624)]
625// stupid enum repr hack
626#[cfg_attr(target_env = "msvc", repr(i32))]
627#[cfg_attr(not(target_env = "msvc"), repr(u32))]
628pub enum SoundType {
629 /// Unknown or custom codec plug-in.
630 Unknown = FMOD_SOUND_TYPE_UNKNOWN,
631 /// Audio Interchange File Format (.aif, .aiff).
632 /// Uncompressed integer formats only.
633 AIFF = FMOD_SOUND_TYPE_AIFF,
634 /// Microsoft Advanced Systems Format (.asf, .wma, .wmv).
635 /// Platform provided decoder, available only on Windows.
636 ASF = FMOD_SOUND_TYPE_ASF,
637 /// Downloadable Sound (.dls).
638 /// Multi-sound bank format used by MIDI (.mid).
639 DLS = FMOD_SOUND_TYPE_DLS,
640 /// Free Lossless Audio Codec (.flac).
641 FLAC = FMOD_SOUND_TYPE_FLAC,
642 /// FMOD Sample Bank (.fsb).
643 /// Proprietary multi-sound bank format.
644 /// Supported encodings: PCM16, FADPCM, Vorbis, AT9, XMA, Opus.
645 FSB = FMOD_SOUND_TYPE_FSB,
646 /// Impulse Tracker (.it).
647 IT = FMOD_SOUND_TYPE_IT,
648 /// Musical Instrument Digital Interface (.mid).
649 MIDI = FMOD_SOUND_TYPE_MIDI,
650 /// Protracker / Fasttracker Module File (.mod).
651 MOD = FMOD_SOUND_TYPE_MOD,
652 /// Moving Picture Experts Group (.mp2, .mp3).
653 /// Also supports .wav (RIFF) container format.
654 MPEG = FMOD_SOUND_TYPE_MPEG,
655 /// Ogg Vorbis (.ogg).
656 OGGVORBIS = FMOD_SOUND_TYPE_OGGVORBIS,
657 /// Play list information container (.asx, .pls, .m3u, .wax).
658 /// No audio, tags only.
659 Playlist = FMOD_SOUND_TYPE_PLAYLIST,
660 /// Raw uncompressed PCM data (.raw).
661 RAW = FMOD_SOUND_TYPE_RAW,
662 /// `ScreamTracker` 3 Module (.s3m).
663 S3M = FMOD_SOUND_TYPE_S3M,
664 /// User created sound.
665 User = FMOD_SOUND_TYPE_USER,
666 /// Microsoft Waveform Audio File Format (.wav).
667 /// Supported encodings: Uncompressed PCM, IMA ADPCM.
668 /// Platform provided ACM decoder extensions, available only on Windows.
669 WAV = FMOD_SOUND_TYPE_WAV,
670 /// `FastTracker` 2 Extended Module (.xm).
671 XM = FMOD_SOUND_TYPE_XM,
672 /// Microsoft XMA bit-stream supported by FSB (.fsb) container format.
673 /// Platform provided decoder, available only on Xbox.
674 XMA = FMOD_SOUND_TYPE_XMA,
675 /// Apple Audio Queue decoder (.mp4, .m4a, .mp3).
676 /// Supported encodings: AAC, ALAC, MP3.
677 /// Platform provided decoder, available only on iOS / tvOS devices.
678 AudioQueue = FMOD_SOUND_TYPE_AUDIOQUEUE,
679 /// Sony ATRAC9 bit-stream supported by FSB (.fsb) container format.
680 /// Platform provided decoder, available only on `PlayStation`.
681 AT9 = FMOD_SOUND_TYPE_AT9,
682 /// Vorbis bit-stream supported by FSB (.fsb) container format.
683 Vorbis = FMOD_SOUND_TYPE_VORBIS,
684 /// Microsoft Media Foundation decoder (.asf, .wma, .wmv, .mp4, .m4a).
685 /// Platform provided decoder, available only on UWP.
686 MediaFoundation = FMOD_SOUND_TYPE_MEDIA_FOUNDATION,
687 /// Google Media Codec decoder (.m4a, .mp4).
688 /// Platform provided decoder, available only on Android.
689 MediaCodec = FMOD_SOUND_TYPE_MEDIACODEC,
690 /// FMOD Adaptive Differential Pulse Code Modulation bit-stream supported by FSB (.fsb) container format.
691 FADPCM = FMOD_SOUND_TYPE_FADPCM,
692 /// Opus bit-stream supported by FSB (.fsb) container format.
693 /// Platform provided decoder, available only on Xbox Series X|S, PS5, and Switch.
694 OPUS = FMOD_SOUND_TYPE_OPUS,
695}
696
697/// These definitions describe the native format of the hardware or software buffer that will be used.
698#[derive(Debug, Clone, Copy, PartialEq, Eq)]
699#[derive(
700 num_enum::TryFromPrimitive,
701 num_enum::IntoPrimitive,
702 num_enum::UnsafeFromPrimitive
703)]
704// stupid enum repr hack
705#[cfg_attr(target_env = "msvc", repr(i32))]
706#[cfg_attr(not(target_env = "msvc"), repr(u32))]
707pub enum SoundFormat {
708 /// Uninitalized / unknown.
709 None = FMOD_SOUND_FORMAT_NONE,
710 /// 8bit integer PCM data.
711 PCM8 = FMOD_SOUND_FORMAT_PCM8,
712 /// 16bit integer PCM data.
713 PCM16 = FMOD_SOUND_FORMAT_PCM16,
714 /// 24bit integer PCM data.
715 PCM24 = FMOD_SOUND_FORMAT_PCM24,
716 /// 32bit integer PCM data.
717 PCM32 = FMOD_SOUND_FORMAT_PCM32,
718 /// 32bit floating point PCM data.
719 PCMFloat = FMOD_SOUND_FORMAT_PCMFLOAT,
720 /// Sound data is in its native compressed format.
721 ///
722 /// See [`FMOD_CREATECOMPRESSEDSAMPLE`]
723 BitStream = FMOD_SOUND_FORMAT_BITSTREAM,
724}
725
726/// List of tag data / metadata types that could be stored within a sound. These include id3 tags, metadata from netstreams and vorbis/asf data.
727#[derive(Debug, Clone, Copy, PartialEq, Eq)]
728#[derive(
729 num_enum::TryFromPrimitive,
730 num_enum::IntoPrimitive,
731 num_enum::UnsafeFromPrimitive
732)]
733// stupid enum repr hack
734#[cfg_attr(target_env = "msvc", repr(i32))]
735#[cfg_attr(not(target_env = "msvc"), repr(u32))]
736pub enum TagType {
737 /// Tag type that is not recognized by FMOD
738 Unknown = FMOD_TAGTYPE_UNKNOWN,
739 /// MP3 ID3 Tag 1.0. Typically 1 tag stored 128 bytes from end of an MP3 file.
740 ID3V1 = FMOD_TAGTYPE_ID3V1,
741 /// MP3 ID3 Tag 2.0. Variable length tags with more than 1 possible.
742 ID3V2 = FMOD_TAGTYPE_ID3V2,
743 /// Metadata container used in Vorbis, FLAC, Theora, Speex and Opus file formats.
744 VorbisComment = FMOD_TAGTYPE_VORBISCOMMENT,
745 /// `SHOUTcast` internet stream metadata which can be issued during playback.
746 ShoutCast = FMOD_TAGTYPE_SHOUTCAST,
747 /// Icecast internet stream metadata which can be issued during playback.
748 IceCast = FMOD_TAGTYPE_ICECAST,
749 /// Advanced Systems Format metadata typically associated with Windows Media formats such as WMA.
750 ASF = FMOD_TAGTYPE_ASF,
751 /// Metadata stored inside a MIDI file.
752 MIDI = FMOD_TAGTYPE_MIDI,
753 /// Playlist files such as PLS,M3U,ASX and WAX will populate playlist information through this tag type.
754 Playlist = FMOD_TAGTYPE_PLAYLIST,
755 /// Tag type used by FMOD's MIDI, MOD, S3M, XM, IT format support, and netstreams to notify of internet stream events like a sample rate change.
756 Fmod = FMOD_TAGTYPE_FMOD,
757 /// For codec developers, this tag type can be used with [`FMOD_CODEC_METADATA_FUNC`] to generate custom metadata.
758 User = FMOD_TAGTYPE_USER,
759}
760
761/// These values describe what state a sound is in after [`FMOD_NONBLOCKING`] has been used to open it.
762#[derive(Debug, Clone, Copy, PartialEq, Eq)]
763// stupid enum repr hack
764#[cfg_attr(target_env = "msvc", repr(i32))]
765#[cfg_attr(not(target_env = "msvc"), repr(u32))]
766pub enum OpenState {
767 /// Opened and ready to play.
768 Ready = FMOD_OPENSTATE_READY,
769 /// Initial load in progress.
770 Loading = FMOD_OPENSTATE_LOADING,
771 /// Failed to open - file not found, out of memory etc.
772 ///
773 /// See return value of [`Sound::get_open_state`]for what happened.
774 Error(Error) = FMOD_OPENSTATE_ERROR,
775 /// Connecting to remote host (internet sounds only).
776 Connecting = FMOD_OPENSTATE_CONNECTING,
777 /// Buffering data.
778 Buffering = FMOD_OPENSTATE_BUFFERING,
779 /// Seeking to subsound and re-flushing stream buffer.
780 Seeking = FMOD_OPENSTATE_SEEKING,
781 /// Ready and playing, but not possible to release at this time without stalling the main thread.
782 Playing = FMOD_OPENSTATE_PLAYING,
783 /// Seeking within a stream to a different position.
784 SetPosition = FMOD_OPENSTATE_SETPOSITION,
785}
786
787impl OpenState {
788 /// Try creating a `OpenState` from its FFI equivalent.
789 pub fn try_from_ffi(value: FMOD_OPENSTATE, error: Option<Error>) -> Result<Self> {
790 match value {
791 FMOD_OPENSTATE_READY => Ok(OpenState::Ready),
792 FMOD_OPENSTATE_LOADING => Ok(OpenState::Loading),
793 FMOD_OPENSTATE_ERROR => error.map(OpenState::Error).ok_or(Error::InvalidParam),
794 FMOD_OPENSTATE_CONNECTING => Ok(OpenState::Connecting),
795 FMOD_OPENSTATE_BUFFERING => Ok(OpenState::Buffering),
796 FMOD_OPENSTATE_SEEKING => Ok(OpenState::Seeking),
797 FMOD_OPENSTATE_PLAYING => Ok(OpenState::Playing),
798 FMOD_OPENSTATE_SETPOSITION => Ok(OpenState::SetPosition),
799 _ => Err(Error::EnumFromPrivitive {
800 name: "LoadingState",
801 primitive: i64::from(value),
802 }),
803 }
804 }
805}
806
807/// Speaker ordering for multi-channel signals.
808#[derive(Debug, Clone, Copy, PartialEq, Eq)]
809#[derive(
810 num_enum::TryFromPrimitive,
811 num_enum::IntoPrimitive,
812 num_enum::UnsafeFromPrimitive
813)]
814// stupid enum repr hack
815#[cfg_attr(target_env = "msvc", repr(i32))]
816#[cfg_attr(not(target_env = "msvc"), repr(u32))]
817pub enum ChannelOrder {
818 /// Left, Right, Center, LFE, Surround Left, Surround Right, Back Left, Back Right (see [`Speaker`] enumeration)
819 Default = FMOD_CHANNELORDER_DEFAULT,
820 /// Left, Right, Center, LFE, Back Left, Back Right, Surround Left, Surround Right (as per Microsoft .wav WAVEFORMAT structure master order)
821 WaveFormat = FMOD_CHANNELORDER_WAVEFORMAT,
822 /// Left, Center, Right, Surround Left, Surround Right, LFE
823 ProTools = FMOD_CHANNELORDER_PROTOOLS,
824 /// Mono, Mono, Mono, Mono, Mono, Mono, ... (each channel up to [`FMOD_MAX_CHANNEL_WIDTH`] treated as mono)
825 AllMono = FMOD_CHANNELORDER_ALLMONO,
826 /// Left, Right, Left, Right, Left, Right, ... (each pair of channels up to [`FMOD_MAX_CHANNEL_WIDTH`] treated as stereo)
827 AllStereo = FMOD_CHANNELORDER_ALLSTEREO,
828 /// Left, Right, Surround Left, Surround Right, Center, LFE (as per Linux ALSA channel order)
829 Alsa = FMOD_CHANNELORDER_ALSA,
830}
831
832/// List of interpolation types used for resampling.
833#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
834#[derive(
835 num_enum::TryFromPrimitive,
836 num_enum::IntoPrimitive,
837 num_enum::UnsafeFromPrimitive
838)]
839// stupid enum repr hack
840#[cfg_attr(target_env = "msvc", repr(i32))]
841#[cfg_attr(not(target_env = "msvc"), repr(u32))]
842pub enum Resampler {
843 /// Default interpolation method, same as [`Resampler::Linear`].
844 #[default]
845 Default = FMOD_DSP_RESAMPLER_DEFAULT,
846 /// No interpolation.
847 /// High frequency aliasing hiss will be audible depending on the sample rate of the sound.
848 NoInterp = FMOD_DSP_RESAMPLER_NOINTERP,
849 /// Linear interpolation (default method).
850 /// Fast and good quality, causes very slight lowpass effect on low frequency sounds.
851 Linear = FMOD_DSP_RESAMPLER_LINEAR,
852 /// Cubic interpolation.
853 /// Slower than linear interpolation but better quality.
854 Cubic = FMOD_DSP_RESAMPLER_CUBIC,
855 /// 5 point spline interpolation.
856 /// Slowest resampling method but best quality.
857 Spline = FMOD_DSP_RESAMPLER_SPLINE,
858}
859
860/// DSP float parameter mappings.
861///
862/// These determine how values are mapped across dials and automation curves.
863#[derive(Debug, Clone, Copy, PartialEq, Eq, Default)]
864#[derive(
865 num_enum::TryFromPrimitive,
866 num_enum::IntoPrimitive,
867 num_enum::UnsafeFromPrimitive
868)]
869// stupid enum repr hack
870#[cfg_attr(target_env = "msvc", repr(i32))]
871#[cfg_attr(not(target_env = "msvc"), repr(u32))]
872pub enum FloatMappingType {
873 /// Values mapped linearly across range.
874 #[default]
875 Linear = FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_LINEAR,
876 /// A mapping is automatically chosen based on range and units.
877 Auto = FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_AUTO,
878 /// Values mapped in a piecewise linear fashion defined by [`FMOD_DSP_PARAMETER_FLOAT_MAPPING_PIECEWISE_LINEAR`].
879 PiecewiceLinear = FMOD_DSP_PARAMETER_FLOAT_MAPPING_TYPE_PIECEWISE_LINEAR,
880}