BASS.NET API for the Un4seen BASS Audio LibraryBassWmaBASS_WMA_GetWMObject Method BASS.NET API for the Un4seen BASS Audio Library
Retrieves a pointer to the IWMReader interface of a WMA stream, or IWMWriter interface of a WMA encoder.

Namespace: Un4seen.Bass.AddOn.Wma
Assembly: Bass.Net (in Bass.Net.dll) Version: 2.4.12.0
Syntax

[DllImportAttribute("basswma.dll", CharSet = CharSet.Auto)]
public static IntPtr BASS_WMA_GetWMObject(
	int handle
)

Parameters

handle
Type: SystemInt32
The WMA stream or encoder handle.

Return Value

Type: IntPtr
If succesful, then a pointer to the requested object is returned, otherwise is returned. Use BASS_ErrorGetCode to get the error code.
Remarks

This function allows those that are familiar with the Windows Media Format SDK to access the internal object interface, for extra functionality. If you create any objects through a retrieved interface, make sure you release the objects before calling BASS_StreamFree(Int32).

See the Windows Media Format SDK for information on the IWMReader and associated interfaces.

When streaming local (not internet) files, this function may actually return an IWMSyncReader interface instead of an IWMReader interface. The type of interface can be determined by querying other interfaces from it, e.g. IWMReaderAdvanced.

See the Windows Media Format SDK for information on the IWMReader, IWMWriter and associated interfaces.

ERROR CODEDescription
BASS_ERROR_HANDLEhandle is not valid.

Examples

Example using the WMFSDK function wrapper and casting it to the IWMHeaderInfo3:
VB
Dim pUnk As IntPtr = Un4seen.Bass.AddOn.Wma.BassWma.BASS_WMA_GetWMObject(stream)
Dim headerInfo3 As IWMHeaderInfo3 = CType(Marshal.GetObjectForIUnknown(pUnk), IWMHeaderInfo3)
If Not (headerInfo3 Is Nothing) Then
  ...
End If
IntPtr pUnk = Un4seen.Bass.AddOn.Wma.BassWma.BASS_WMA_GetWMObject(stream);
IWMHeaderInfo3 headerInfo3 = (IWMHeaderInfo3)Marshal.GetObjectForIUnknown( pUnk );
if (headerInfo3 != null)
{
  ...
}
See Also

Reference