AudRecordLib
Classes | Defines | Typedefs | Functions
exports.h File Reference

Defines the exported functions and structures. More...

#include <wmsdk.h>
#include <mmdeviceapi.h>
#include "IAudRecordInterface.h"

Go to the source code of this file.

Classes

struct  _CodecConfiguration
struct  _Codec
struct  _CodecConfigs
struct  _Endpoint
struct  _EndpointArray

Defines

#define AUDRECORD_API   __declspec(dllimport)

Typedefs

typedef struct _CodecConfiguration CodecConfiguration
typedef struct _Codec Codec
typedef struct _CodecConfigs CodecConfigs
typedef struct _Endpoint Endpoint
typedef struct _EndpointArray EndpointArray
typedef PVOID(WINAPI * pfnAlloc )(PVOID pUserData, SIZE_T bytesRequired)
typedef void(WINAPI * pfnFree )(PVOID pUserData, PVOID pMemory)

Functions

AUDRECORD_API HRESULT WINAPI GetWMACodecConfigs (CodecConfigs **ppConfigs)
AUDRECORD_API void WINAPI FreeWMACodecConfigs (CodecConfigs *pConfigs)
AUDRECORD_API HRESULT WINAPI GetAudioEndpoints (EndpointArray **ppEndpoints)
AUDRECORD_API void WINAPI FreeAudioEndpoints (EndpointArray *pEndpoints)
AUDRECORD_API HRESULT WINAPI CreateAudRecordInterface (CodecConfiguration *pCodecConfig, IAudRecord **ppAudRecord)
AUDRECORD_API PVOID WINAPI SetAllocFreeFunctions (pfnAlloc allocFn, pfnFree freeFn, PVOID pUserData)
AUDRECORD_API void WINAPI DumpUnfreedAllocations ()

Detailed Description

Defines the exported functions and structures.


Define Documentation

#define AUDRECORD_API   __declspec(dllimport)

Resolves to nothing if building the AudRecord dll otherwise to __declspec(dllimport)


Typedef Documentation

typedef struct _Codec Codec

Information about an installed codec

typedef struct _CodecConfigs CodecConfigs

A collection of codecs and their configurations

Information regarding a single codec configuration

typedef struct _Endpoint Endpoint

Represents a single audio rendering device.

typedef struct _EndpointArray EndpointArray

A collection of audio render devices which can potentially be captured from

typedef PVOID(WINAPI* pfnAlloc)(PVOID pUserData, SIZE_T bytesRequired)

Typedef for the custom alloc function form

typedef void(WINAPI* pfnFree)(PVOID pUserData, PVOID pMemory)

Custom free function form


Function Documentation

AUDRECORD_API HRESULT WINAPI CreateAudRecordInterface ( CodecConfiguration pCodecConfig,
IAudRecord **  ppAudRecord 
)

Create an IAudRecord interface using the specified codec.

Creates a new IAudRecord interface and calls ChangeCodec with the pCodecConfig parameter. Recording does not start until you add one or more targets with the AddFileTarget, AddNetworkTarget, or AddCustomTarget member functions and call Record with an Endpoint returnen from GetAudioEndpoints. COM must be initialized before calling this function. When you no longer need the IAudRecord object, free it by calling Release()

Parameters:
pCodecConfigThe initial codec configuration to use as for the output
[out]ppAudRecord
Returns:
S_OK on success, standard COM error on failure including E_POINTER and CO_E_NOTINITIALIZED
See also:
CodecConfiguration, IAudRecord
AUDRECORD_API void WINAPI DumpUnfreedAllocations ( )

In debug builds, AudRecord keeps a list of all allocations made either by the default allocation functions or by those set by SetAllocFreeFunctions(). Calling this function dumps all allocations and stack traces via both the ETW debug stream and the debuggers text output via OutputDebugStringA()

AUDRECORD_API void WINAPI FreeAudioEndpoints ( EndpointArray pEndpoints)

Frees a list of audio render endpoints allocated by GetAudioEndpoints

Parameters:
pEndpointsThe allocated pointer retrieved from GetAudioEndpoints
See also:
GetAudioEndpoints
AUDRECORD_API void WINAPI FreeWMACodecConfigs ( CodecConfigs pConfigs)

Frees a list of codec configurations allocated by GetWMACodecConfigs

Parameters:
pConfigsThe allocated pointer retrieved from GetWMACodecConfigs
Returns:
Nothing
See also:
GetWMACodecConfigs
AUDRECORD_API HRESULT WINAPI GetAudioEndpoints ( EndpointArray **  ppEndpoints)

Returns an list of all installed audio output devices.

Retrieves the list of possible devices to capture audio on along with their name and description. One of these endpoints must be passed to IAudRecord::Record to begin recording. CoInitialize must be called prior to calling this function and the returned pointer must be freed with FreeAudioEndpoints when it is no longer required

Parameters:
[out]ppEndpointsA pointer to a pointer that receives the allocated audio endpoints
Returns:
S_OK on success, standard COM error code on failure including E_POINTER and CO_E_NOTINITIALIZED
See also:
EndpointArray, FreeAudioEndpoints, IAudRecord::Record
AUDRECORD_API HRESULT WINAPI GetWMACodecConfigs ( CodecConfigs **  ppConfigs)

Returns an list of all installed audio codec configurations.

Retrieves the list of usable codecs and a list of each CBR and VBR configuration they support. These configurations can be passed to CreateAudRecordInterface and IAudRecord::ChangeCodec to define the compression format and bitrate used. CoInitialize must be called prior to calling this function

Parameters:
[out]ppConfigsA pointer to a pointer that receives the allocated codec configurations
Returns:
S_OK on success, standard COM error code on failure including E_POINTER and CO_E_NOTINITIALIZED
See also:
CodecConfigs, FreeWMACodecConfigs, CreateAudRecordInterface and IAudRecord::ChangeCodec
AUDRECORD_API PVOID WINAPI SetAllocFreeFunctions ( pfnAlloc  allocFn,
pfnFree  freeFn,
PVOID  pUserData 
)

Sets the functions used to allocate and free the memory AudRecordLib requires

If this function isn't called, HeapAlloc and HeapFree are used.

Parameters:
allocFnFunction which should allocate memory
freeFnFrees the memory returned by allocFn
pUserDataOpaque blob of context data that is passed to both functions untouched
Returns:
The value of pUserData from the previous call
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Defines