Use Delphi to make recording program

Source: Internet
Author: User

Delphi is a inprise (former Borland) company's excellent visual programming tool, its own MediaPlayer control is the development of multimedia tools. It takes a few minutes to make a program like Jie Ba that can play multimedia files. But perhaps few people know that it can also be used to make a recording program.

Run Delphi, drag a MediaPlayer control onto the form on the system page, and the default name is Mediaplayer1. Because our program is using its own button, set the Mediaplayer1 Visible property to False, and the other properties remain the default value. Put two more buttons Button1 and Button2. The Button1 property name is changed to Btstart,caption to start recording, and Button2 's property name is changed to Btstop,caption to stop recording, and the Enabled property to False. Then switch the window to the code window and start writing the code.

In the program, we define a WAV file header format, recording the first to create a file with only the head of the WAV file, and then Mediaplayer1 recorded the sound into the file. Some of the parameters of Createwav process are as follows: The first channels for the channel, 1 o'clock for the mono, and 2 o'clock for the stereo. Resolution also has only two values to choose from, 8 o'clock on behalf of 8-bit voice, 16 o'clock to represent 16-bit voice, rate is the voice frequency, such as 11025,22050, 44100. The greater the value, the clearer the sound, and of course the larger the recorded file. The last argument represents the corresponding file name. So createwav can have the following forms:

Createwav (1,8,11025, ' C:\abc.wav '); Create a 8-bit mono frequency 11025 wav file named Abc.wav in the C-packing directory

Createwav (2,16,44100, ' C:\abc.wav '); Create a WAV file named Abc.wav with 16-bit stereo frequency 44100 in the C-packing directory

A very famous foreign-written remote control software NetBus has a voice monitoring function, is written in the method of this article. It first records the other person's voice, and then transmits it back to monitor the other person's purpose. Of course, the premise is that each other must have a microphone installed, otherwise the supervisor heard the sound of the other player (such as open Jie Ba or Readplay play, run this program, you can record the sound of playback).

In fact, now the network sound communication technology has developed to a certain stage, voice to make up the IP phone, etc. also began to mature. However, they are in Vox format or ACM format, the specific code can be downloaded on my homepage http://Lovejingtao.126.com. But if the Vox or the ACM format is not familiar with friends, you can use this method to make their own "recorder." As for how to call the system from the Avifil32.dll to do network video playback, when there is a chance to communicate with you.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.