internal IntPtr GetProperty(AudioFilePropertyId id, uint size) { // Callers must release this! var unmanagedValue = Marshal.AllocHGlobal((int)size); SafeNativeMethods.AudioFileGetProperty(Handle, id, ref size, unmanagedValue); return(unmanagedValue); }
internal T GetProperty <T>(AudioFilePropertyId id) where T : unmanaged { var size = (uint)Marshal.SizeOf(typeof(T)); var unmanagedValue = Marshal.AllocHGlobal((int)size); try { SafeNativeMethods.AudioFileGetProperty(Handle, id, ref size, unmanagedValue); return(Marshal.PtrToStructure <T>(unmanagedValue)); } finally { Marshal.FreeHGlobal(unmanagedValue); } }
internal static extern AudioFileStatus AudioFileGetPropertyInfo( [NotNull] AudioFileHandle handle, AudioFilePropertyId id, out uint dataSize, out uint isWritable);
internal static extern AudioFileStatus AudioFileGetProperty( [NotNull] AudioFileHandle handle, AudioFilePropertyId id, ref uint size, [Out] IntPtr data);
internal void GetPropertyInfo(AudioFilePropertyId id, out uint dataSize, out uint isWritable) => SafeNativeMethods.AudioFileGetPropertyInfo(Handle, id, out dataSize, out isWritable);
internal AudioFileStatus GetPropertyInfo(AudioFilePropertyId id, out uint dataSize, out uint isWritable) { return(SafeNativeMethods.AudioFileGetPropertyInfo(Handle, id, out dataSize, out isWritable)); }