mnSetInputFormat

This command is used to control the format of sound. This command impacts on the quality of sound input.

This command must be used before the input instance is setup using mnStartInput.

If you do not want to change an option set it to 0 and it will be left unchanged.

The sound format of the instance used to play data (mnPlayData) must be the same as the format of the data. So if you want to play sound from an output instance, the output instance must have the same format as the input instance. You can change the sound output format of an instance using mnSetOutputFormat, mnSetOutputFormatHigh, mnSetOutputFormatMedium and mnSetOutputFormatLow.

By default the sound input format is medium (mnSetInputFormatMedium).

Parameters

int InstanceID: The input instance ID that this command should use.

unsigned short Channels: The number of channels. Monaural data uses one channel and stereo data uses two channels. If there are two channels, sound input can have different volume where channel 1 may represent left speaker and channel 2 may represent right speaker.

unsigned int SamplesPerSec: Sample rate in hertz. Common values are 8000, 11025, 22050, and 44100.

unsigned int BitsPerSample: Bits per sample. This should be 8 or 16. If 8 then each sample of sound will be one byte in size, if 16 then each sample of sound will be two bytes in size.

Returns (Integer)

0 if no error occurred.

-1 if an error occurred.

Present in

DBP

C++

.Net




This page is in the following sections:
(2) Sound Input
(1) Sound Input and Output
(0) DarkNet Help