Home > Software engineering >  How to use vb API is saved as a wav recording?
How to use vb API is saved as a wav recording?

Time:09-24

How to use vb API is saved as a wav recording?
http://bbs.csdn.net/topics/10291998

CodePudding user response:

http://bbs.csdn.net/topics/50015346

CodePudding user response:

http://blog.csdn.net/tanaya/article/details/33109

CodePudding user response:

The sample (Multimedia controls MCI)
Visual Basic example

The following example shows how to open a process of MCI device compatible data file is used, the code in the Form_Load process, an application can use Multimedia Gong to MCI control file. The wav to broadcast, record and rewind, before the trial run this example, first should create a form containing Multimedia controls MCI,

 Private Sub Form_Load () 
'Set the properties men by MCI to open.
MMControl1. Notify=FALSE
MMControl1. Wait=TRUE
MMControl1. Shareable=FALSE
MMControl1. DeviceType="WaveAudio"
MMControl1. FileName="C: \ WINDOWS \ MMDATA \ GONG WAV"

'open the MCI WaveAudio equipment,
MMControl1.Com mand="Open"
End Sub


In order to properly manage the Multimedia resources, before exit the application should close the open MCI device, put the following statement in Form_Unload process, so before exit contains Multimedia MCI control forms, can shut down those already open MCI device,

 Private Sub Form_Unload (Cancel As Integer) 
MMControl1.Com mand="Close"
End Sub

CodePudding user response:

Record
The record The command starts recording The data. The VCR and waveform - audio devices recognize this command. Over The digital - video devices and MIDI sequencers also recognize this command, The MCIAVI and MCISEQ drivers do not implement it.

Wsprintf (lpstrCommand, record % s % s "% s", lpszDeviceID, lpszRecordFlags,
LpszFlags);

The Parameters
LpszDeviceID
Identifier of the an MCI device. This Identifier or alias is assigned when the device is the opened.
LpszRecordFlags
Flag for recording The data. The following table lists The device types that recognize The record The command and The flags, informs by each type: digitalvideo at a rectangle
Audio stream, stream
From the position
Hold the insert
Overwrite
To the position
Video stream, stream
Sequencer from position
Insert the overwrite
To the position
At the time a VCR
From the position
Initialize the insert
Overwrite
To the position
Waveaudio from position
Insert the overwrite
To the position


The following table lists The flags that can be specified in The lpszRecordFlags parameter and their meanings: at a rectangle Specifies a rectangular region of The external input, informs The as The source for The pixels compressed and saved. If not specified, The rectangle defaults to The rectangle specified for put "video". When it is set differently from The "video" a rectangle, The displayed image is not what is recorded.
At the time are the when the device should begin performing this command, or, if the device has had been cued, the when the cued command begins. For more information, see the cue command.
Audio stream, stream Specifies the audio stream, informs for recording. If this flag is not specified and the file format does not define a default, it is recorded into the stream that is physically first.
From the position Specifies a starting position for the recording. If the "from" flag is not specified, the device starts recording at the current position.
Home hold Freezes the image when recording from the finished showing live video. When recording stops, an automatic monitor "file" command is performed. To return To the live video, issue the monitor "is input" command.
Initialize the initialize the tape (media), which involves recording timecode (if possible) for blank video and audio. This command took take several hours if the - tape must be initialized.
Insert Specifies that the new data is added to the file at the current position.
Overwrite Specifies that the new data will replace the data in the file.
To the position Specifies an ending position for the recording. If the "to" flag is not specified, the device records until it receives a stop or pause command.
Video stream, stream Specifies the video stream, informs for recording. If this is not specified and the file format does not define a default, then it is recorded into the stream that is physically first.



LpszFlags
Can be "wait" and "notify", or both, For digital video and VCR devices, "test" Can also be specified. For more information about these flags, see The wait, notify, and test flags.
The Return Values
Returns zero if successful, or an error otherwise.

Few
The recording stops when a stop or pause command is issued, The For The MCIWAVE driver, all data recorded after a file is The opened is discarded if The file is closed without saving it.

Before issuing any commands that use the position values, you should set the desired time format by using the set command. The tracks to be recorded are specified by the settimecode "record", set "assemble record", setvideo "record", and setaudio "record" commands.

The following command starts recording at The current position:

nullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnullnull
  • Related