public void Dispose() { if (this.id != 0u) { AudioSampleProvider.InternalSetScriptingPtr(this.id, null); this.id = 0u; } GC.SuppressFinalize(this); }
static internal AudioSampleProvider Lookup( uint providerId, Object ownerObj, ushort trackIndex) { AudioSampleProvider provider = InternalGetScriptingPtr(providerId); if (provider != null || !InternalIsValid(providerId)) { return(provider); } return(new AudioSampleProvider(providerId, ownerObj, trackIndex)); }
private AudioSampleProvider(uint providerId, UnityEngine.Object ownerObj, ushort trackIdx) { this.owner = ownerObj; this.id = providerId; this.trackIndex = trackIdx; this.m_ConsumeSampleFramesNativeFunction = (AudioSampleProvider.ConsumeSampleFramesNativeFunction)Marshal.GetDelegateForFunctionPointer(AudioSampleProvider.InternalGetConsumeSampleFramesNativeFunctionPtr(), typeof(AudioSampleProvider.ConsumeSampleFramesNativeFunction)); ushort channelCount = 0; uint sampleRate = 0u; AudioSampleProvider.InternalGetFormatInfo(providerId, out channelCount, out sampleRate); this.channelCount = channelCount; this.sampleRate = sampleRate; AudioSampleProvider.InternalSetScriptingPtr(providerId, this); }
internal static AudioSampleProvider Lookup(uint providerId, UnityEngine.Object ownerObj, ushort trackIndex) { AudioSampleProvider audioSampleProvider = AudioSampleProvider.InternalGetScriptingPtr(providerId); AudioSampleProvider result; if (audioSampleProvider != null) { result = audioSampleProvider; } else { result = new AudioSampleProvider(providerId, ownerObj, trackIndex); } return(result); }
internal uint QueueSampleFrames(NativeArray <float> sampleFrames) { bool flag = this.channelCount == 0; uint result; if (flag) { result = 0u; } else { result = AudioSampleProvider.InternalQueueSampleFrames(this.id, (IntPtr)sampleFrames.GetUnsafeReadOnlyPtr <float>(), (uint)(sampleFrames.Length / (int)this.channelCount)); } return(result); }
public void Dispose() { bool flag = this.id > 0u; if (flag) { AudioSampleProvider.InternalSetScriptingPtr(this.id, null); bool flag2 = this.owner == null; if (flag2) { AudioSampleProvider.InternalRemove(this.id); } this.id = 0u; } GC.SuppressFinalize(this); }
internal static AudioSampleProvider Create(ushort channelCount, uint sampleRate) { uint providerId = AudioSampleProvider.InternalCreateSampleProvider(channelCount, sampleRate); bool flag = !AudioSampleProvider.InternalIsValid(providerId); AudioSampleProvider result; if (flag) { result = null; } else { result = new AudioSampleProvider(providerId, null, 0); } return(result); }
private static extern void InternalSetScriptingPtr( uint providerId, AudioSampleProvider provider);
public void ClearSampleFramesOverflowNativeHandler() { AudioSampleProvider.InternalClearSampleFramesOverflowNativeHandler(this.id); }
public void SetSampleFramesOverflowNativeHandler(AudioSampleProvider.SampleFramesEventNativeFunction handler, IntPtr userData) { AudioSampleProvider.InternalSetSampleFramesOverflowNativeHandler(this.id, Marshal.GetFunctionPointerForDelegate(handler), userData); }
public void ClearSampleFramesAvailableNativeHandler() { AudioSampleProvider.InternalClearSampleFramesAvailableNativeHandler(this.id); }
public static void UnregisterSampleProvider(this AudioSource source, AudioSampleProvider provider) { Internal_UnregisterSampleProviderFromAudioSource(source, provider.id); }
public static void RegisterSampleProvider(this AudioSource source, AudioSampleProvider provider) { Internal_RegisterSampleProviderWithAudioSource(source, provider.id); }
public static float GetSpeed(this AudioSampleProvider provider) { return(InternalGetAudioSampleProviderSpeed(provider.id)); }