// // Generated by Brutal.Fmod.Generate; do not edit by hand. #nullable enable namespace Brutal.FmodApi { public static partial class Fmod { /// /// /// Frees a sound object. /// /// /// This will stop any instances of this sound, and free the sound object and its children if it is a /// multi-sound object. /// /// /// If the sound was opened with FMOD_NONBLOCKING and hasn't finished opening yet, it will block. /// Additionally, if the sound is still playing or has recently been stopped, the release may stall, as the /// mixer may still be using the sound. Using Sound::getOpenState and checking the open state for /// FMOD_OPENSTATE_READY and FMOD_OPENSTATE_ERROR is a good way to avoid stalls. /// /// /// See Also: System::createSound, Sound::getSubSound /// /// /// Sound::release /// /// public static Result TryRelease(this Sound sound) => PInvoke.SoundRelease(sound); /// /// /// Frees a sound object. /// /// /// This will stop any instances of this sound, and free the sound object and its children if it is a /// multi-sound object. /// /// /// If the sound was opened with FMOD_NONBLOCKING and hasn't finished opening yet, it will block. /// Additionally, if the sound is still playing or has recently been stopped, the release may stall, as the /// mixer may still be using the sound. Using Sound::getOpenState and checking the open state for /// FMOD_OPENSTATE_READY and FMOD_OPENSTATE_ERROR is a good way to avoid stalls. /// /// /// See Also: System::createSound, Sound::getSubSound /// /// /// Sound::release /// /// public static void Release(this Sound sound) => TryRelease(sound).Check(); /// /// /// Retrieves the parent System object. /// /// /// Sound::getSystemObject /// /// public static unsafe Result TryGetSystemObject(this Sound sound, out FmodSystem system) { fixed (FmodSystem* systemPtr = &system) return PInvoke.SoundGetSystemObject(sound, systemPtr); } /// /// /// Retrieves the parent System object. /// /// /// Sound::getSystemObject /// /// public static FmodSystem GetSystemObject(this Sound sound) { TryGetSystemObject(sound, out var system).Check(); return system; } /// /// /// Gives access to a portion or all the sample data of a sound for direct manipulation. /// /// /// Sound::lock /// /// public static unsafe Result TryLock( this Sound sound, uint offset, uint length, out nint ptr1, out nint ptr2, out uint len1, out uint len2 ) { fixed (nint* ptr1Ptr = &ptr1) fixed (nint* ptr2Ptr = &ptr2) fixed (uint* len1Ptr = &len1) fixed (uint* len2Ptr = &len2) return PInvoke.SoundLock(sound, offset, length, ptr1Ptr, ptr2Ptr, len1Ptr, len2Ptr); } /// /// /// Gives access to a portion or all the sample data of a sound for direct manipulation. /// /// /// Sound::lock /// /// public static void Lock( this Sound sound, uint offset, uint length, out nint ptr1, out nint ptr2, out uint len1, out uint len2 ) => TryLock(sound, offset, length, out ptr1, out ptr2, out len1, out len2).Check(); /// /// /// Finalizes a previous sample data lock and submits it back to the Sound object. /// /// /// Sound::unlock /// /// public static Result TryUnlock(this Sound sound, nint ptr1, nint ptr2, uint len1, uint len2) => PInvoke.SoundUnlock(sound, ptr1, ptr2, len1, len2); /// /// /// Finalizes a previous sample data lock and submits it back to the Sound object. /// /// /// Sound::unlock /// /// public static void Unlock(this Sound sound, nint ptr1, nint ptr2, uint len1, uint len2) => TryUnlock(sound, ptr1, ptr2, len1, len2).Check(); /// /// /// Sets a sound's default playback attributes. /// /// /// When the Sound is played it will use these values without having to specify them later on a per Channel /// basis. /// /// /// Sound::setDefaults /// /// public static Result TrySetDefaults(this Sound sound, float frequency, int priority) => PInvoke.SoundSetDefaults(sound, frequency, priority); /// /// /// Sets a sound's default playback attributes. /// /// /// When the Sound is played it will use these values without having to specify them later on a per Channel /// basis. /// /// /// Sound::setDefaults /// /// public static void SetDefaults(this Sound sound, float frequency, int priority) => TrySetDefaults(sound, frequency, priority).Check(); /// /// /// Retrieves a sound's default playback attributes. /// /// /// Sound::getDefaults /// /// public static unsafe Result TryGetDefaults(this Sound sound, out float frequency, out int priority) { fixed (float* frequencyPtr = &frequency) fixed (int* priorityPtr = &priority) return PInvoke.SoundGetDefaults(sound, frequencyPtr, priorityPtr); } /// /// /// Retrieves a sound's default playback attributes. /// /// /// Sound::getDefaults /// /// public static void GetDefaults(this Sound sound, out float frequency, out int priority) => TryGetDefaults(sound, out frequency, out priority).Check(); /// /// /// Sets the minimum and maximum audible distance for a 3D sound. /// /// /// Sound::set3DMinMaxDistance /// /// public static Result TrySet3dMinMaxDistance(this Sound sound, float min, float max) => PInvoke.SoundSet3dMinMaxDistance(sound, min, max); /// /// /// Sets the minimum and maximum audible distance for a 3D sound. /// /// /// Sound::set3DMinMaxDistance /// /// public static void Set3dMinMaxDistance(this Sound sound, float min, float max) => TrySet3dMinMaxDistance(sound, min, max).Check(); /// /// /// Retrieve the minimum and maximum audible distance for a 3D sound. /// /// /// Sound::get3DMinMaxDistance /// /// public static unsafe Result TryGet3dMinMaxDistance(this Sound sound, out float min, out float max) { fixed (float* minPtr = &min) fixed (float* maxPtr = &max) return PInvoke.SoundGet3dMinMaxDistance(sound, minPtr, maxPtr); } /// /// /// Retrieve the minimum and maximum audible distance for a 3D sound. /// /// /// Sound::get3DMinMaxDistance /// /// public static void Get3dMinMaxDistance(this Sound sound, out float min, out float max) => TryGet3dMinMaxDistance(sound, out min, out max).Check(); /// /// /// Sets the angles and attenuation levels of a 3D cone shape, for simulated occlusion which is based on /// direction. /// /// /// Sound::set3DConeSettings /// /// public static Result TrySet3dConeSettings( this Sound sound, float insideConeAngle, float outsideConeAngle, float outsideVolume ) => PInvoke.SoundSet3dConeSettings(sound, insideConeAngle, outsideConeAngle, outsideVolume); /// /// /// Sets the angles and attenuation levels of a 3D cone shape, for simulated occlusion which is based on /// direction. /// /// /// Sound::set3DConeSettings /// /// public static void Set3dConeSettings( this Sound sound, float insideConeAngle, float outsideConeAngle, float outsideVolume ) => TrySet3dConeSettings(sound, insideConeAngle, outsideConeAngle, outsideVolume).Check(); /// /// /// Retrieves the inside and outside angles of the 3D projection cone and the outside volume. /// /// /// Sound::get3DConeSettings /// /// public static unsafe Result TryGet3dConeSettings( this Sound sound, out float insideConeAngle, out float outsideConeAngle, out float outsideVolume ) { fixed (float* insideConeAnglePtr = &insideConeAngle) fixed (float* outsideConeAnglePtr = &outsideConeAngle) fixed (float* outsideVolumePtr = &outsideVolume) return PInvoke.SoundGet3dConeSettings(sound, insideConeAnglePtr, outsideConeAnglePtr, outsideVolumePtr); } /// /// /// Retrieves the inside and outside angles of the 3D projection cone and the outside volume. /// /// /// Sound::get3DConeSettings /// /// public static void Get3dConeSettings( this Sound sound, out float insideConeAngle, out float outsideConeAngle, out float outsideVolume ) => TryGet3dConeSettings(sound, out insideConeAngle, out outsideConeAngle, out outsideVolume).Check(); /// /// /// Sets a custom roll-off shape for 3D distance attenuation. /// /// /// Sound::set3DCustomRolloff /// /// public static unsafe Result TrySet3dCustomRolloff(this Sound sound, float3* points, int numPoints) => PInvoke.SoundSet3dCustomRolloff(sound, points, numPoints); /// /// /// Sets a custom roll-off shape for 3D distance attenuation. /// /// /// Sound::set3DCustomRolloff /// /// public static unsafe void Set3dCustomRolloff(this Sound sound, float3* points, int numPoints) => TrySet3dCustomRolloff(sound, points, numPoints).Check(); /// /// /// Retrieves the current custom roll-off shape for 3D distance attenuation. /// /// /// Sound::get3DCustomRolloff /// /// public static unsafe Result TryGet3dCustomRolloff(this Sound sound, out float3* points, out int numPoints) { fixed (float3** pointsPtr = &points) fixed (int* numPointsPtr = &numPoints) return PInvoke.SoundGet3dCustomRolloff(sound, pointsPtr, numPointsPtr); } /// /// /// Retrieves the current custom roll-off shape for 3D distance attenuation. /// /// /// Sound::get3DCustomRolloff /// /// public static unsafe void Get3dCustomRolloff(this Sound sound, out float3* points, out int numPoints) => TryGet3dCustomRolloff(sound, out points, out numPoints).Check(); /// /// /// Retrieves a handle to a Sound object that is contained within the parent sound. /// /// /// Sound::getSubSound /// /// public static unsafe Result TryGetSubSound(this Sound sound, int index, out Sound subSound) { fixed (Sound* subSoundPtr = &subSound) return PInvoke.SoundGetSubSound(sound, index, subSoundPtr); } /// /// /// Retrieves a handle to a Sound object that is contained within the parent sound. /// /// /// Sound::getSubSound /// /// public static Sound GetSubSound(this Sound sound, int index) { TryGetSubSound(sound, index, out var subSound).Check(); return subSound; } /// /// /// Retrieves the parent Sound object that contains this subsound. /// /// /// Sound::getSubSoundParent /// /// public static unsafe Result TryGetSubSoundParent(this Sound sound, out Sound parentSound) { fixed (Sound* parentSoundPtr = &parentSound) return PInvoke.SoundGetSubSoundParent(sound, parentSoundPtr); } /// /// /// Retrieves the parent Sound object that contains this subsound. /// /// /// Sound::getSubSoundParent /// /// public static Sound GetSubSoundParent(this Sound sound) { TryGetSubSoundParent(sound, out var parentSound).Check(); return parentSound; } /// /// /// Retrieves the name of a sound. /// /// /// Sound::getName /// /// public static unsafe Result TryGetName(this Sound sound, byte* name, int nameLen) => PInvoke.SoundGetName(sound, name, nameLen); /// /// /// Retrieves the name of a sound. /// /// /// Sound::getName /// /// public static unsafe void GetName(this Sound sound, byte* name, int nameLen) => TryGetName(sound, name, nameLen).Check(); /// /// /// Retrieves the length using the specified time unit. /// /// /// Sound::getLength /// /// public static unsafe Result TryGetLength(this Sound sound, out uint length, TimeUnit lengthType) { fixed (uint* lengthPtr = &length) return PInvoke.SoundGetLength(sound, lengthPtr, lengthType); } /// /// /// Retrieves the length using the specified time unit. /// /// /// Sound::getLength /// /// public static uint GetLength(this Sound sound, TimeUnit lengthType) { TryGetLength(sound, out var length, lengthType).Check(); return length; } /// /// /// Returns format information about the sound. /// /// /// Sound::getFormat /// /// public static unsafe Result TryGetFormat( this Sound sound, out SoundType type, out SoundFormat format, out int channels, out int bits ) { fixed (SoundType* typePtr = &type) fixed (SoundFormat* formatPtr = &format) fixed (int* channelsPtr = &channels) fixed (int* bitsPtr = &bits) return PInvoke.SoundGetFormat(sound, typePtr, formatPtr, channelsPtr, bitsPtr); } /// /// /// Returns format information about the sound. /// /// /// Sound::getFormat /// /// public static void GetFormat( this Sound sound, out SoundType type, out SoundFormat format, out int channels, out int bits ) => TryGetFormat(sound, out type, out format, out channels, out bits).Check(); /// /// /// Retrieves the number of subsounds stored within a sound. /// /// /// Sound::getNumSubSounds /// /// public static unsafe Result TryGetNumSubSounds(this Sound sound, out int numSubSounds) { fixed (int* numSubSoundsPtr = &numSubSounds) return PInvoke.SoundGetNumSubSounds(sound, numSubSoundsPtr); } /// /// /// Retrieves the number of subsounds stored within a sound. /// /// /// Sound::getNumSubSounds /// /// public static int GetNumSubSounds(this Sound sound) { TryGetNumSubSounds(sound, out var numSubSounds).Check(); return numSubSounds; } /// /// /// Retrieves the number of metadata tags. /// /// /// Sound::getNumTags /// /// public static unsafe Result TryGetNumTags(this Sound sound, out int numTags, out int numTagsUpdated) { fixed (int* numTagsPtr = &numTags) fixed (int* numTagsUpdatedPtr = &numTagsUpdated) return PInvoke.SoundGetNumTags(sound, numTagsPtr, numTagsUpdatedPtr); } /// /// /// Retrieves the number of metadata tags. /// /// /// Sound::getNumTags /// /// public static void GetNumTags(this Sound sound, out int numTags, out int numTagsUpdated) => TryGetNumTags(sound, out numTags, out numTagsUpdated).Check(); /// /// /// Retrieves a metadata tag. /// /// /// Sound::getTag /// /// public static unsafe Result TryGetTag(this Sound sound, RefString8 name, int index, out Tag tag) { fixed (byte* namePtr = name) fixed (Tag* tagPtr = &tag) return PInvoke.SoundGetTag(sound, namePtr, index, tagPtr); } /// /// /// Retrieves a metadata tag. /// /// /// Sound::getTag /// /// public static Tag GetTag(this Sound sound, RefString8 name, int index) { TryGetTag(sound, name, index, out var tag).Check(); return tag; } /// /// /// Retrieves the state a sound is in after being opened with the non blocking flag, or the current state of /// the streaming buffer. /// /// /// Sound::getOpenState /// /// public static unsafe Result TryGetOpenState( this Sound sound, out OpenState openState, out uint percentBuffered, out Bool32 starving, out Bool32 diskBusy ) { fixed (OpenState* openStatePtr = &openState) fixed (uint* percentBufferedPtr = &percentBuffered) fixed (Bool32* starvingPtr = &starving) fixed (Bool32* diskBusyPtr = &diskBusy) return PInvoke.SoundGetOpenState(sound, openStatePtr, percentBufferedPtr, starvingPtr, diskBusyPtr); } /// /// /// Retrieves the state a sound is in after being opened with the non blocking flag, or the current state of /// the streaming buffer. /// /// /// Sound::getOpenState /// /// public static void GetOpenState( this Sound sound, out OpenState openState, out uint percentBuffered, out Bool32 starving, out Bool32 diskBusy ) => TryGetOpenState(sound, out openState, out percentBuffered, out starving, out diskBusy).Check(); /// /// /// Reads data from an opened sound to a specified buffer, using FMOD's internal codecs. /// /// /// Sound::readData /// /// public static unsafe Result TryReadData(this Sound sound, nint buffer, uint length, out uint read) { fixed (uint* readPtr = &read) return PInvoke.SoundReadData(sound, buffer, length, readPtr); } /// /// /// Reads data from an opened sound to a specified buffer, using FMOD's internal codecs. /// /// /// Sound::readData /// /// public static uint ReadData(this Sound sound, nint buffer, uint length) { TryReadData(sound, buffer, length, out var read).Check(); return read; } /// /// /// Seeks a sound for use with data reading, using FMOD's internal codecs. /// /// /// Sound::seekData /// /// public static Result TrySeekData(this Sound sound, uint pcm) => PInvoke.SoundSeekData(sound, pcm); /// /// /// Seeks a sound for use with data reading, using FMOD's internal codecs. /// /// /// Sound::seekData /// /// public static void SeekData(this Sound sound, uint pcm) => TrySeekData(sound, pcm).Check(); /// /// /// Moves the sound from its existing SoundGroup to the specified sound group. /// /// /// Sound::setSoundGroup /// /// public static Result TrySetSoundGroup(this Sound sound, SoundGroup soundGroup) => PInvoke.SoundSetSoundGroup(sound, soundGroup); /// /// /// Moves the sound from its existing SoundGroup to the specified sound group. /// /// /// Sound::setSoundGroup /// /// public static void SetSoundGroup(this Sound sound, SoundGroup soundGroup) => TrySetSoundGroup(sound, soundGroup).Check(); /// /// /// Retrieves the sound's current sound group. /// /// /// Sound::getSoundGroup /// /// public static unsafe Result TryGetSoundGroup(this Sound sound, out SoundGroup soundGroup) { fixed (SoundGroup* soundGroupPtr = &soundGroup) return PInvoke.SoundGetSoundGroup(sound, soundGroupPtr); } /// /// /// Retrieves the sound's current sound group. /// /// /// Sound::getSoundGroup /// /// public static SoundGroup GetSoundGroup(this Sound sound) { TryGetSoundGroup(sound, out var soundGroup).Check(); return soundGroup; } /// /// /// Retrieves the number of sync points stored within a sound. /// /// /// Sound::getNumSyncPoints /// /// public static unsafe Result TryGetNumSyncPoints(this Sound sound, out int numSyncPoints) { fixed (int* numSyncPointsPtr = &numSyncPoints) return PInvoke.SoundGetNumSyncPoints(sound, numSyncPointsPtr); } /// /// /// Retrieves the number of sync points stored within a sound. /// /// /// Sound::getNumSyncPoints /// /// public static int GetNumSyncPoints(this Sound sound) { TryGetNumSyncPoints(sound, out var numSyncPoints).Check(); return numSyncPoints; } /// /// /// Retrieve a sync point. /// /// /// Sound::getSyncPoint /// /// public static unsafe Result TryGetSyncPoint(this Sound sound, int index, out SyncPoint point) { fixed (SyncPoint* pointPtr = &point) return PInvoke.SoundGetSyncPoint(sound, index, pointPtr); } /// /// /// Retrieve a sync point. /// /// /// Sound::getSyncPoint /// /// public static SyncPoint GetSyncPoint(this Sound sound, int index) { TryGetSyncPoint(sound, index, out var point).Check(); return point; } /// /// /// Retrieves information on an embedded sync point. /// /// /// Sound::getSyncPointInfo /// /// public static unsafe Result TryGetSyncPointInfo( this Sound sound, SyncPoint point, byte* name, int nameLen, out uint offset, TimeUnit offsetType ) { fixed (uint* offsetPtr = &offset) return PInvoke.SoundGetSyncPointInfo(sound, point, name, nameLen, offsetPtr, offsetType); } /// /// /// Retrieves information on an embedded sync point. /// /// /// Sound::getSyncPointInfo /// /// public static unsafe uint GetSyncPointInfo( this Sound sound, SyncPoint point, byte* name, int nameLen, TimeUnit offsetType ) { TryGetSyncPointInfo(sound, point, name, nameLen, out var offset, offsetType).Check(); return offset; } /// /// /// Adds a sync point at a specific time within the sound. /// /// /// Sound::addSyncPoint /// /// public static unsafe Result TryAddSyncPoint( this Sound sound, uint offset, TimeUnit offsetType, RefString8 name, out SyncPoint point ) { fixed (byte* namePtr = name) fixed (SyncPoint* pointPtr = &point) return PInvoke.SoundAddSyncPoint(sound, offset, offsetType, namePtr, pointPtr); } /// /// /// Adds a sync point at a specific time within the sound. /// /// /// Sound::addSyncPoint /// /// public static SyncPoint AddSyncPoint(this Sound sound, uint offset, TimeUnit offsetType, RefString8 name) { TryAddSyncPoint(sound, offset, offsetType, name, out var point).Check(); return point; } /// /// /// Deletes a sync point within the sound. /// /// /// Sound::deleteSyncPoint /// /// public static Result TryDeleteSyncPoint(this Sound sound, SyncPoint point) => PInvoke.SoundDeleteSyncPoint(sound, point); /// /// /// Deletes a sync point within the sound. /// /// /// Sound::deleteSyncPoint /// /// public static void DeleteSyncPoint(this Sound sound, SyncPoint point) => TryDeleteSyncPoint(sound, point).Check(); /// /// /// Sets or alters the mode of a sound. /// /// /// Sound::setMode /// /// public static Result TrySetMode(this Sound sound, Mode mode) => PInvoke.SoundSetMode(sound, mode); /// /// /// Sets or alters the mode of a sound. /// /// /// Sound::setMode /// /// public static void SetMode(this Sound sound, Mode mode) => TrySetMode(sound, mode).Check(); /// /// /// Retrieves the mode of a sound. /// /// /// Sound::getMode /// /// public static unsafe Result TryGetMode(this Sound sound, out Mode mode) { fixed (Mode* modePtr = &mode) return PInvoke.SoundGetMode(sound, modePtr); } /// /// /// Retrieves the mode of a sound. /// /// /// Sound::getMode /// /// public static Mode GetMode(this Sound sound) { TryGetMode(sound, out var mode).Check(); return mode; } /// /// /// Sets the sound to loop a specified number of times before stopping if the playback mode is set to /// looping. /// /// /// Sound::setLoopCount /// /// public static Result TrySetLoopCount(this Sound sound, int loopCount) => PInvoke.SoundSetLoopCount(sound, loopCount); /// /// /// Sets the sound to loop a specified number of times before stopping if the playback mode is set to /// looping. /// /// /// Sound::setLoopCount /// /// public static void SetLoopCount(this Sound sound, int loopCount) => TrySetLoopCount(sound, loopCount).Check(); /// /// /// Retrieves the sound's loop count. /// /// /// Sound::getLoopCount /// /// public static unsafe Result TryGetLoopCount(this Sound sound, out int loopCount) { fixed (int* loopCountPtr = &loopCount) return PInvoke.SoundGetLoopCount(sound, loopCountPtr); } /// /// /// Retrieves the sound's loop count. /// /// /// Sound::getLoopCount /// /// public static int GetLoopCount(this Sound sound) { TryGetLoopCount(sound, out var loopCount).Check(); return loopCount; } /// /// /// Sets the loop points within a sound. /// /// /// Sound::setLoopPoints /// /// public static Result TrySetLoopPoints( this Sound sound, uint loopStart, TimeUnit loopStartType, uint loopEnd, TimeUnit loopEndType ) => PInvoke.SoundSetLoopPoints(sound, loopStart, loopStartType, loopEnd, loopEndType); /// /// /// Sets the loop points within a sound. /// /// /// Sound::setLoopPoints /// /// public static void SetLoopPoints( this Sound sound, uint loopStart, TimeUnit loopStartType, uint loopEnd, TimeUnit loopEndType ) => TrySetLoopPoints(sound, loopStart, loopStartType, loopEnd, loopEndType).Check(); /// /// /// Retrieves the loop points for a sound. /// /// /// Sound::getLoopPoints /// /// public static unsafe Result TryGetLoopPoints( this Sound sound, out uint loopStart, TimeUnit loopStartType, out uint loopEnd, TimeUnit loopEndType ) { fixed (uint* loopStartPtr = &loopStart) fixed (uint* loopEndPtr = &loopEnd) return PInvoke.SoundGetLoopPoints(sound, loopStartPtr, loopStartType, loopEndPtr, loopEndType); } /// /// /// Retrieves the loop points for a sound. /// /// /// Sound::getLoopPoints /// /// public static void GetLoopPoints( this Sound sound, out uint loopStart, TimeUnit loopStartType, out uint loopEnd, TimeUnit loopEndType ) => TryGetLoopPoints(sound, out loopStart, loopStartType, out loopEnd, loopEndType).Check(); /// /// /// Gets the number of music channels inside a MOD/S3M/XM/IT/MIDI file. /// /// /// Sound::getMusicNumChannels /// /// public static unsafe Result TryGetMusicNumChannels(this Sound sound, out int numChannels) { fixed (int* numChannelsPtr = &numChannels) return PInvoke.SoundGetMusicNumChannels(sound, numChannelsPtr); } /// /// /// Gets the number of music channels inside a MOD/S3M/XM/IT/MIDI file. /// /// /// Sound::getMusicNumChannels /// /// public static int GetMusicNumChannels(this Sound sound) { TryGetMusicNumChannels(sound, out var numChannels).Check(); return numChannels; } /// /// /// Sets the volume of a MOD/S3M/XM/IT/MIDI music channel volume. /// /// /// Sound::setMusicChannelVolume /// /// public static Result TrySetMusicChannelVolume(this Sound sound, int channel, float volume) => PInvoke.SoundSetMusicChannelVolume(sound, channel, volume); /// /// /// Sets the volume of a MOD/S3M/XM/IT/MIDI music channel volume. /// /// /// Sound::setMusicChannelVolume /// /// public static void SetMusicChannelVolume(this Sound sound, int channel, float volume) => TrySetMusicChannelVolume(sound, channel, volume).Check(); /// /// /// Retrieves the volume of a MOD/S3M/XM/IT/MIDI music channel volume. /// /// /// Sound::getMusicChannelVolume /// /// public static unsafe Result TryGetMusicChannelVolume(this Sound sound, int channel, out float volume) { fixed (float* volumePtr = &volume) return PInvoke.SoundGetMusicChannelVolume(sound, channel, volumePtr); } /// /// /// Retrieves the volume of a MOD/S3M/XM/IT/MIDI music channel volume. /// /// /// Sound::getMusicChannelVolume /// /// public static float GetMusicChannelVolume(this Sound sound, int channel) { TryGetMusicChannelVolume(sound, channel, out var volume).Check(); return volume; } /// /// /// Sets the relative speed of MOD/S3M/XM/IT/MIDI music. /// /// /// Sound::setMusicSpeed /// /// public static Result TrySetMusicSpeed(this Sound sound, float speed) => PInvoke.SoundSetMusicSpeed(sound, speed); /// /// /// Sets the relative speed of MOD/S3M/XM/IT/MIDI music. /// /// /// Sound::setMusicSpeed /// /// public static void SetMusicSpeed(this Sound sound, float speed) => TrySetMusicSpeed(sound, speed).Check(); /// /// /// Gets the relative speed of MOD/S3M/XM/IT/MIDI music. /// /// /// Sound::getMusicSpeed /// /// public static unsafe Result TryGetMusicSpeed(this Sound sound, out float speed) { fixed (float* speedPtr = &speed) return PInvoke.SoundGetMusicSpeed(sound, speedPtr); } /// /// /// Gets the relative speed of MOD/S3M/XM/IT/MIDI music. /// /// /// Sound::getMusicSpeed /// /// public static float GetMusicSpeed(this Sound sound) { TryGetMusicSpeed(sound, out var speed).Check(); return speed; } /// /// /// Sets a user value associated with this object. /// /// /// Sound::setUserData /// /// public static Result TrySetUserData(this Sound sound, nint userData) => PInvoke.SoundSetUserData(sound, userData); /// /// /// Sets a user value associated with this object. /// /// /// Sound::setUserData /// /// public static void SetUserData(this Sound sound, nint userData) => TrySetUserData(sound, userData).Check(); /// /// /// Retrieves a user value associated with this object. /// /// /// Sound::getUserData /// /// public static unsafe Result TryGetUserData(this Sound sound, out nint userData) { fixed (nint* userDataPtr = &userData) return PInvoke.SoundGetUserData(sound, userDataPtr); } /// /// /// Retrieves a user value associated with this object. /// /// /// Sound::getUserData /// /// public static nint GetUserData(this Sound sound) { TryGetUserData(sound, out var userData).Check(); return userData; } } }