예제 #1
0
        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);
        }
예제 #2
0
        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);
            }
        }
예제 #3
0
 internal static extern AudioFileStatus AudioFileGetPropertyInfo(
     [NotNull] AudioFileHandle handle,
     AudioFilePropertyId id,
     out uint dataSize,
     out uint isWritable);
예제 #4
0
 internal static extern AudioFileStatus AudioFileGetProperty(
     [NotNull] AudioFileHandle handle,
     AudioFilePropertyId id,
     ref uint size,
     [Out] IntPtr data);
예제 #5
0
 internal void GetPropertyInfo(AudioFilePropertyId id, out uint dataSize, out uint isWritable) =>
 SafeNativeMethods.AudioFileGetPropertyInfo(Handle, id, out dataSize, out isWritable);
예제 #6
0
 internal AudioFileStatus GetPropertyInfo(AudioFilePropertyId id, out uint dataSize, out uint isWritable)
 {
     return(SafeNativeMethods.AudioFileGetPropertyInfo(Handle, id, out dataSize, out isWritable));
 }