Use a recording device on a Nokia mobile phone (1)

Source: Internet
Author: User

Author: Ding Dong,Huaqing vision embedded CollegeLecturer.

Including the Symbian platform and meego platform, which have started to support QT software development. If you develop an audioProgramFirst, we need to introduce several classes.

Qmediarecorder:

This class is mainly used to access the content of audio devices. Although this class does not have the ability to access audio, it can be used in combination with other classes, such as qaudiocapturesource and qradiotuner, to access audio, the following is how to load an audio file on a mobile phone device.

Audiosource-New qaudiocapturesource;
Recorder = new qmediarecorder (audiosource );
// Manages audio sources

Qaudiencodersettings audiosettings;
Audiosettings. setcodec ("adio/Vorbis ");
Audiosettings. setquality (qtmedia: highquality );

Recorder-> setencodingsettings (audiosettings );
Recorder-> setoutputlocation (qurl: fromlocalfile (filename ));
// Use macro-defined methods on different platforms to select the compatibility of Software Migration
// # Ifndef q_symbian_ OS
// # Else
Recorder-> record ();
Next, record the sound

Qaudiocapturesource:

This class provides an access point for audio, which is used to access the current audio input. This class is platform-based.CodeIs used to access an input content:

Qaudiocapturesource * audiocapturesource = new qaudiocapturesource;
Qmediarecorder * capture = new qmediarecorder (audiocapturesource );

The audiocapturesource interface is used to obtain and set the current audio input.

The capture interface is used to set the current audio input location and audio format parameters, such as encoding. Use record () for audio recording and stop () for audio recording.

In the second article, we will introduce the development of a recorder applet on a mobile phone.

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.