IMMWaveAudio

The IMMWaveAudio class provides recording and playing of sound files. The sound files are stored in a waveform format. Not only can you use the inherited functions, such as play, pause, and setFormat, but you can also use this class for cutting, copying, and pasting to and from an audio buffer.


IMMWaveAudio - Member Functions and Data by Group

Constructors & Destructor

You can construct and destruct objects of this class.


[view class]
~IMMWaveAudio
public:
virtual ~IMMWaveAudio()

Supported Platforms

Windows OS/2 AIX
Yes Yes No


[view class]
IMMWaveAudio


Overload 1
public:
IMMWaveAudio( bool openNow = true, unsigned long instance = 0, bool openShareable = true )

You can construct an IMMWaveAudio from the following:

openNow
If true, it causes the device to automatically open the device before returning from the constructor; otherwise, you would have to call one of the open functions to open the device yourself.
instance
You can provide your own instance number instead of letting IMMWaveAudio generate one.
openShareable
If true, it allows the hardware device to be shared by different programs; otherwise, the hardware cannot be shared.

Supported Platforms

Windows OS/2 AIX
Yes Yes No


Overload 2
protected:
IMMWaveAudio( unsigned long deviceIdentifier, const IString& newAlias = IString ( ) )

A derived class can construct an IMMWaveAudio from the following:

deviceIdentifier
The value the system uses to identify the device.
newAlias
The name you can use to associate a string to the device. Optional.

Supported Platforms

Windows OS/2 AIX
Yes Yes No


Buffers

Use these members to edit the audio using buffers and setting attributes for the current audio.


[view class]
copyFromBuffer
public:
virtual IMMWaveAudio& copyFromBuffer( const IMMAudioBuffer& audioBuffer, CallType call = wait )

Copies all of the audio data from the audio buffer to the current location.

Exception

IAccessError The device identifier is not valid; possibly the device is closed.
IAccessError The device cannot acquire access to the hardware device; possibly another device of this same type was acquired for exclusive use in this or another process.
IAccessError An internal driver error occurred.
IInvalidRequest The device must be in the open state before calling this function.

Supported Platforms

Windows OS/2 AIX
No Yes No


[view class]
copyToBuffer
public:
virtual IMMWaveAudio& copyToBuffer( IMMAudioBuffer& audioBuffer, const IMMTime& from = IMMTime ( ), const IMMTime& to = IMMTime ( ), CallType call = wait ) const

Copies audio data into the audio buffer from the passed-in begin position to the passed-in end position. If from is omitted, it uses the current position; if to is omitted, it uses the end of the audio data.

Exception

IAccessError The device identifier is not valid; possibly the device is closed.
IAccessError The device cannot acquire access to the hardware device; possibly another device of this same type was acquired for exclusive use in this or another process.
IAccessError An internal driver error occurred.
IInvalidRequest The device must be in the open state before calling this function.
IAccessError The buffer is too small to hold that data.
IAccessError The passed-in range is invalid; either the to or the from position does not point to a valid position or the difference between from and to is not greater than zero.

Supported Platforms

Windows OS/2 AIX
No Yes No


[view class]
cutCopyBufferSize
public:
virtual unsigned long cutCopyBufferSize( const IMMTime& from = IMMTime ( ), const IMMTime& to = IMMTime ( ) ) const

Returns the size the audio buffer needs to be to contain the audio data from the passed-in beginning position to the passed-in ending position. If from is omitted, it uses the current position; if to is omitted, it uses the end of the audio data.

Exception

IAccessError The device identifier is not valid; possibly the device is closed.
IAccessError The device cannot acquire access to the hardware device; possibly another device of this same type was acquired for exclusive use in this or another process.
IAccessError An internal driver error occurred.
IInvalidRequest The device must be in the open state before calling this function.
IAccessError The buffer is too small to hold that data.
IAccessError The passed-in range is invalid; either the to or the from position does not point to a valid position or the difference between from and to is not greater than zero.

Supported Platforms

Windows OS/2 AIX
No Yes No


[view class]
cutToBuffer
public:
virtual IMMWaveAudio& cutToBuffer( IMMAudioBuffer& audioBuffer, const IMMTime& from = IMMTime ( ), const IMMTime& to = IMMTime ( ), CallType call = wait )

Cuts audio data into the audio buffer from the passed-in begin position to the passed-in end position. If from is omitted, it uses the current position; if to is omitted, it uses the end of the audio data.

Exception

IAccessError The device identifier is not valid; possibly the device is closed.
IAccessError The device cannot acquire access to the hardware device; possibly another device of this same type was acquired for exclusive use in this or another process.
IAccessError An internal driver error occurred.
IInvalidRequest The device must be in the open state before calling this function.
IAccessError The buffer is too small to hold that data.
IAccessError The passed-in range is invalid; either the to or the from position does not point to a valid position or the difference between from and to is not greater than zero.

Supported Platforms

Windows OS/2 AIX
No Yes No


[view class]
pasteFromBuffer
public:
virtual IMMWaveAudio& pasteFromBuffer( const IMMAudioBuffer& audioBuffer, const IMMTime& from = IMMTime ( ), const IMMTime& to = IMMTime ( ), CallType call = wait )

Replaces the audio data with data from the audio buffer, from the passed-in begin position to the passed-in end position. If neither from nor to is specified, then it inserts the data at the current position. If from is omitted, it uses the start of the buffer; if to is omitted, it uses the end of the audio data in the buffer.

Exception

IAccessError The device identifier is not valid; possibly the device is closed.
IAccessError The device cannot acquire access to the hardware device; possibly another device of this same type was acquired for exclusive use in this or another process.
IAccessError An internal driver error occurred.
IInvalidRequest The device must be in the open state before calling this function.
IAccessError The passed-in range is invalid; either the to or the from position does not point to a valid position or the difference between from and to is not greater than zero.

Supported Platforms

Windows OS/2 AIX
No Yes No


[view class]
pasteToBuffer
public:
virtual IMMWaveAudio& pasteToBuffer( IMMAudioBuffer& audioBuffer, CallType call = wait ) const

Pastes audio data into the passed-in audio buffer.

Exception

IAccessError The device identifier is not valid; possibly the device is closed.
IAccessError The device cannot acquire access to the hardware device; possibly another device of this same type was acquired for exclusive use in this or another process.
IAccessError An internal driver error occurred.
IInvalidRequest The device must be in the open state before calling this function.
IAccessError The buffer is too small to hold that data.

Supported Platforms

Windows OS/2 AIX
No Yes No


[view class]
supportsWaveFormat
public:
virtual bool supportsWaveFormat( unsigned long bitsPerSample, unsigned long samplesPerSecond, unsigned long channels, IMMAudioBuffer::Format format, CallType call = wait ) const

Returns true if the format is supported. This allows an application to determine whether a specific wave audio format is supported.

Exception

IAccessError The device identifier is not valid; possibly the device is closed.
IAccessError The device cannot acquire access to the hardware device; possibly another device of this same type was acquired for exclusive use in this or another process.
IAccessError An internal driver error occurred.
IInvalidRequest The device must be in the open state before calling this function.
IAccessError The device hardware does not support this format; possibly the combination of the passed-in audio attributes is not supported by the system.

Supported Platforms

Windows OS/2 AIX
No Yes No


Implementation

These members check if the passed-in string is in the correct format to open the current device.


[view class]
isOpenStringValid
protected:
virtual bool isOpenStringValid( const IString& deviceName ) const

Returns true if the passed-in open string is valid for this device.

Supported Platforms

Windows OS/2 AIX
Yes Yes No


[view class]
restoreDeviceSettings
protected:
virtual IMMWaveAudio& restoreDeviceSettings( bool newRecordMode = false )

Restores settings for the current device. Derived classes should override this function, handle class-specific settings, and call the corresponding inherited function.

Supported Platforms

Windows OS/2 AIX
Yes No No


[view class]
saveDeviceSettings
protected:
virtual IMMWaveAudio& saveDeviceSettings()

Saves settings for the current device. Derived classes should override this function, handle class-specific settings, and call the corresponding inherited function.

Supported Platforms

Windows OS/2 AIX
Yes No No


IMMWaveAudio - Inherited Member Functions and Data

Inherited Public Functions

IMMConfigurableAudio
IMMDevice
IMMFileMedia
IMMPlayableDevice
IMMRecordable
INotifier
IStandardNotifier

Inherited Public Data

INotifier
IMMDevice

Inherited Protected Functions

INotifier
IStandardNotifier
IMMDevice
IMMFileMedia
IMMConfigurableAudio
IMMPlayableDevice
IMMRecordable

Inherited Protected Data