source: trunk/demos/spectrum/README.txt@ 865

Last change on this file since 865 was 769, checked in by Dmitry A. Kuminov, 15 years ago

trunk: Merged in qt 4.6.3 sources from branches/vendor/nokia/qt.

File size: 5.1 KB
Line 
1Spectrum analyser demo app
2==========================
3
4Introduction
5------------
6
7This application is a demo which uses the QtMultimedia APIs to capture and play back PCM audio. While either recording or playback is ongoing, the application performs real-time level and frequency spectrum analysis, displaying the results in its main window.
8
9
10Acknowledgments
11---------------
12
13The application uses the FFTReal v2.00 library by Laurent de Soras to perform frequency analysis of the audio signal. For further information, see the project home page:
14 http://ldesoras.free.fr/prod.html
15
16
17Quick start
18-----------
19
20Play generated tone
211. Select 'Play generated tone' from the mode menu
222. Ensure that the 'Frequency sweep' box is checked
233. Press 'OK'
244. Press the play button
25You should hear a rising tone, and see progressively higher frequencies indicated by the spectrograph.
26
27Record and playback
281. Select 'Record and play back audio' from the mode menu
292. Press the record button, and speak into the microphone
303. Wait until the buffer is full (shown as a full blue bar in the top widget)
314. Press play, and wait until playback of the buffer is complete
32
33Play file
341. Select 'Play file' from the mode menu
352. Select a WAV file
363. Press the play button
37You should hear the first few seconds of the file being played. The waveform, spectrograph and level meter should be updated as the file is played.
38
39
40Things to play with
41-------------------
42
43Try repeating the 'Play generated tone' sequence using different window functions. These can be selected from the settings dialog - launch it by pressing the spanner icon. The window function is applied to the audio signal before performing the frequency analysis; different windows should have a visible effect on the resulting frequency spectrum.
44
45Try clicking on one of the spectrograph bars while the tone is being played. The frequency range for that bar will be displayed at the top of the application window.
46
47
48Troubleshooting
49---------------
50
51If either recording or playback do not work, you may need to select a different input / output audio device. This can be done in the settings dialog - launch it by pressing the spanner icon.
52
53If that doesn't work, there may be a problem either in the application or in Qt. Report a bug in the usual way.
54
55
56Application interface
57---------------------
58
59The main window of the application contains the following widgets, starting at the top:
60
61Message box
62This shows various messages during execution, such as the current audio format.
63
64Progress bar / waveform display
65- While recording or playback is ongoing, the audio waveform is displayed, sliding from right to left.
66- Superimposed on the waveform, the amount of data currently in the buffer is showed as a blue bar. When recording, this blue bar fills up from left to right; when playing, the bar gets consumed from left to right.
67- A green window shows which part of the buffer has most recently been analysed. This window should be close to the 'leading edge' of recording or playback, i.e. the most recently recorded / played data, although it will lag slightly depending on the performance of the machine on which the application is running.
68
69Frequency spectrograph (on the left)
70The spectrograph shows 10 bars, each representing a frequency range. The frequency range of each bar is displayed in the message box when the bar is clicked. The height of the bar shows the maximum amplitude of freqencies within its range.
71
72Level meter (on the right)
73The current peak audio level is shown as a pink bar; the current RMS level is shown as a red bar. The 'high water mark' during a recent period is shown as a thin red line.
74
75Button panel
76- The mode menu allows switching between the three operation modes - 'Play generated tone', 'Record and play back' and 'Play file'.
77- The record button starts or resumes audio capture from the current input device.
78- The pause button suspends either capture or recording.
79- The play button starts or resumes audio playback to the current output device.
80- The settings button launches the settings dialog.
81
82
83Hacking
84-------
85
86If you want to hack the application, here are some pointers to get started.
87
88The spectrum.pri file contains several macros which you can enable by uncommenting:
89- LOG_FOO Enable logging from class Foo via qDebug()
90- DUMP_FOO Dump data from class Foo to the file system
91 e.g. DUMP_SPECTRUMANALYSER writes files containing the raw FFT input and output.
92 Be aware that this can generate a *lot* of data and may slow the app down considerably.
93- DISABLE_FOO Disable specified functionality
94
95If you don't like the combination of the waveform and progress bar in a single widget, separate them by commenting out SUPERIMPOSE_PROGRESS_ON_WAVEFORM.
96
97The spectrum.h file defines a number of parameters which can be played with. These control things such as the number of audio samples analysed per FFT calculation, the range and number of bands displayed by the spectrograph, and so on.
98
99The part of the application which interacts with QtMultimedia is in the Engine class.
100
101Some ideas for enhancements to the app are listed in TODO.txt. Feel free to start work on any of them :)
102
103
Note: See TracBrowser for help on using the repository browser.