AudRecordLib
Public Member Functions
IAudRecord Interface Reference

import "IAudRecord.idl";

Inheritance diagram for IAudRecord:
AudRecord

List of all members.

Public Member Functions

HRESULT Record ([in]struct _Endpoint *pDevice)
HRESULT ChangeCodec ([in]struct _CodecConfiguration *pNewCodec)
HRESULT TogglePause ([out, retval]AudPausedState *pState)
HRESULT QueryPause ([out, retval]AudPausedState *pState)
HRESULT Stop ()
HRESULT AddFileTarget ([in]LPCWSTR pwszFileName,[out]PVOID *ppCookie)
HRESULT AddNetworkBroadcastTarget ([in, out]DWORD *pPort,[in]DWORD maxConnectors,[out]LPWSTR *ppwszUrl,[out]PVOID *ppCookie)
HRESULT AddCustomTarget ([in]IWMWriterSink *pTarget,[out]PVOID *ppCookie)
HRESULT RemoveTarget ([in]PVOID pTargetCookie)
HRESULT GetStatistics ([out]AudRecordStats *pStats)

Detailed Description

Exposes methods to control the recording of the live audio stream.

Controls a live recording session including codec configuration and file and network targets. Also provides methods for querying statistics and


Member Function Documentation

HRESULT IAudRecord::AddCustomTarget ( [in] IWMWriterSink *  pTarget,
[out] PVOID *  ppCookie 
)

Adds a custom target to the recording process.

Parameters:
pTargetA pointer to the IWMWriterSink
[out]ppCookieA pointer that receives a value that can be passed to RemoveTarget() to remove the target from the recording process

Implemented in AudRecord.

HRESULT IAudRecord::AddFileTarget ( [in] LPCWSTR  pwszFileName,
[out] PVOID *  ppCookie 
)

Adds a file target to the recording process

Adds an additional file target to the recording session. If the file exists, it will be overwritten. A target can added at any time before or after Record() has been called.

Parameters:
pwszFileNameThe WMA file to create
[out]ppCookieA pointer that receives a value that can be passed to RemoveTarget() to remove the target from the recording process
Returns:
S_OK on success, E_POINTER if either pwszFileName and ppCookie are NULL

Implemented in AudRecord.

HRESULT IAudRecord::AddNetworkBroadcastTarget ( [in, out] DWORD *  pPort,
[in] DWORD  maxConnectors,
[out] LPWSTR *  ppwszUrl,
[out] PVOID *  ppCookie 
)

Opens a port that clients can connect to and receive the recorded stream.

Adds a broadcasting target to the current recording session. A target can added at any time before or after Record() has been called.

Parameters:
[in,out]pPortOptional value that on input, specifies the port to bind to. On output, returns the port actually used.
maxConnectorsThe maximum number of clients that can connect to the stream, 5 is the default
[out]ppwszUrlOption pointer to a string that receives the full URL of the stream
[out]ppCookieA pointer that receives a value that can be passed to RemoveTarget() to remove the target from the recording process
Returns:
S_OK on success, E_POINTER if ppCookie is NULL, or a NS_E_* error value if the target cannot be created

Implemented in AudRecord.

HRESULT IAudRecord::ChangeCodec ( [in] struct _CodecConfiguration pNewCodec)

Changes the compression parameters of the recording stream.

If the stream is currently recording it will be stopped, the compression changed then the stream started again. This will overwrite any files created by file targets. To alleviate this problem manually Stop() the stream, call ChangeCodec(), archive the files and then call Record() again with the same EndPoint

Parameters:
pNewCodecThe new codec compression configuration to set
Returns:
S_OK on success, E_POINTER if pNewCodec or pNewCodec->pConfig are NULL, or a NS_E_* value.

Implemented in AudRecord.

HRESULT IAudRecord::GetStatistics ( [out] AudRecordStats pStats)

Retrieves the statistics for the recording session

Parameters:
[out]pStatsA pointer to a struct to fill with the statistics
Returns:
S_OK on success, E_POINTER if pStats is NULL

Implemented in AudRecord.

HRESULT IAudRecord::QueryPause ( [out, retval] AudPausedState pState)

Queries the state of the recording stream.

Parameters:
[out]pStatePointer to a value that receives the current state of the recording stream on function success. A nonzero value means the stream is recording, zero/FALSE indicates a paused state
Returns:
S_OK on success or E_UNEXPECTED if Record() hasn't been called

Implemented in AudRecord.

HRESULT IAudRecord::Record ( [in] struct _Endpoint pDevice)

Starts recording from the specified endpoint

Starts a recording session capturing output from the specified endpoint. At least one file, network, or custom target must be set before calling this function.

Returns:
S_OK on success, E_UNEXPECTED if there are no targets and NS_E_CODEC_NOT_INSTALLED if an agreement on sample formats between the endpoint and the codec cannot be reached.
Parameters:
pDeviceThe device to capture from
Returns:
S_OK on success, E_UNEXPECTED if Record has already been called
See also:
GetAudioEndpoints, IAudRecord::AddFileTarget, IAudRecord::AddNetworkBroadcastingTarget and IAudRecord::AddCustomTarget

Implemented in AudRecord.

HRESULT IAudRecord::RemoveTarget ( [in] PVOID  pTargetCookie)

Removes a target from the recording process.

If the cookie refers to a network target, the port it references is closed. If it refers to a file, the handle is released. If it refers to a custom sink, the reference count is decremented.

Parameters:
pTargetCookieThe cookie value returned by one of the Add*Target functions
Returns:
S_OK on success, E_POINTER if pTargetCookie is NULL, E_INVALIDARG if pTargetCookie doesn't refer to a valid object

Implemented in AudRecord.

HRESULT IAudRecord::Stop ( )

Stops the recording process

Stops the recording thread, ends the writing process and releases internal resources. After this function is called, Record() must be called to start

Returns:
Always returns S_OK

Implemented in AudRecord.

HRESULT IAudRecord::TogglePause ( [out, retval] AudPausedState pState)

Pauses/resumes the recording.

If the current state of the stream is recording, this function stops collecting samples from the endpoint but leaves the recording session open, so it can be resumed by calling this function again. If the stream is paused, the function begins collecting samples again and writing them to the targets

Parameters:
[out]pStateOptional pointer to a value that receives the current state of the recording stream on function success. A nonzero value means the stream is recording, zero/FALSE indicates a paused state
Returns:
S_OK on success or E_UNEXPECTED if Record() hasn't been called

Implemented in AudRecord.


The documentation for this interface was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Defines