AudRecordLib
Functions
exports.cpp File Reference

Implements the exported functions. More...

#include "stdafx.h"
#include "exports.h"
#include "wmfunctions.h"
#include "device.h"
#include "misc.h"
#include "alloc.h"

Functions

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

Detailed Description

Implements the exported functions.


Function Documentation

AUDRECORD_API HRESULT 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 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 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 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 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 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