summaryrefslogtreecommitdiffstats
path: root/doc
diff options
context:
space:
mode:
authorDmytro Poplavskiy <dmytro.poplavskiy@nokia.com>2012-01-18 14:46:58 +1000
committerQt by Nokia <qt-info@nokia.com>2012-01-19 03:56:45 +0100
commit69cef0c24c1f6500d6047ae9c093fda26cf203a6 (patch)
tree364a7e22759f574ef502bed240b7764b261edd56 /doc
parent8c74e5e7e7a5654f1af670b6d40f98e736d1f7d9 (diff)
Replaced QAudioCaptureSource with QAudioRecorder.
QAudioCaptureSource name is confusing, it's essentially an audio recording service but it's not evident from API. QAudioRecorder replaces QAudioCaptureSource+QMediaRecorder combination. Change-Id: I0082d766fc0d1b8d5ecbfc527f13e715add730c8 Reviewed-by: Michael Goddard <michael.goddard@nokia.com>
Diffstat (limited to 'doc')
-rw-r--r--doc/src/multimedia.qdoc27
1 files changed, 12 insertions, 15 deletions
diff --git a/doc/src/multimedia.qdoc b/doc/src/multimedia.qdoc
index 3abafe0c6..cd0e402b8 100644
--- a/doc/src/multimedia.qdoc
+++ b/doc/src/multimedia.qdoc
@@ -61,49 +61,47 @@ API to quickly build functionality.
The first step is to demonstrate recording audio to a file. When recording from an audio source there are a number of things we may want to control beyond the essential user interface. We may want a particular encoding of the file, MP3 or Ogg Vorbis for instance, or select a different input source. The user may modify the bitrate, number of channels, quality and sample rate. Here the example will only modify the codec and the source device, since they are essential.
-To begin, the developer sets up a source and a recorder object. A
-\l{QAudioCaptureSource} object is created and used to initialize a \l{QMediaRecorder} object. The output file name is then set for the \l{QMediaRecorder} object.
+To begin, the developer sets up an audio recorder object. A
+\l{QAudioRecorder} object is created. The output file name is then set for the \l{QMediaRecorder} object.
\code
- audiosource = new QAudioCaptureSource;
- capture = new QMediaRecorder(audiosource);
-
- capture->setOutputLocation(QUrl("test.raw"));
+ audioRecorder = new QAudioRecorder;
+ audioRecorder->setOutputLocation(QUrl("test.raw"));
\endcode
A list of devices is needed so that an input can be selected in the user interface
\code
- for(int i = 0; i < audiosource->deviceCount(); i++)
+ for (int i = 0; i < audioRecorder->deviceCount(); i++)
deviceBox->addItem(audiosource->name(i));
\endcode
and a list of the supported codecs for the user to select a codec,
\code
- QStringList codecs = capture->supportedAudioCodecs();
- for(int i = 0; i < codecs.count(); i++)
+ QStringList codecs = audioRecorder->supportedAudioCodecs();
+ for (int i = 0; i < codecs.count(); i++)
codecsBox->addItem(codecs.at(i));
\endcode
To set the selected device or codec just use the index of the device or codec by calling the setter in \i {audiosource} or \i {capture} as appropriate, for example,
\code
- audiosource->setSelectedDevice(i);
+ audioRecorder->setSelectedDevice(i);
...
- capture->setAudioCodec(codecIdx);
+ audioRecorder->setAudioCodec(codecIdx);
\endcode
Now start recording by using the \l {QMediaRecorder}{record()} function from the new \l{QMediaRecorder} object
\code
- capture->record();
+ audioRecorder->record();
\endcode
And stop recording by calling the matching function \l {QMediaRecorder::stop()}{stop()} in \l{QMediaRecorder}.
\code
- capture->stop();
+ audioRecorder->stop();
\endcode
How then would this audio file be played? The \l {QMediaPlayer} class will be
@@ -228,8 +226,7 @@ the next photo.
\section2 Video Clips
Previously we saw code that allowed the capture of a still image. Recording
-video requires the use of a \l QMediaRecorder object and a \l
-QAudioCaptureSource for sound.
+video requires the use of a \l QMediaRecorder object.
To record video we need a camera object, as before, a media recorder and a
viewfinder object. The media recorder object will need to be initialized.