Name Description Size Coverage
qaudio.h 2584 -
qaudio_dr_wav.cpp 231 -
qaudio_parsing_support.cpp 14949 -
qaudio_parsing_support_p.h 4342 -
qaudio_platform_implementation_support_p.h 19715 -
qaudio_qiodevice_support_p.h data 7933 -
qaudio_qspan_support_p.h 1082 -
qaudiobuffer.cpp ! \class QAbstractAudioBuffer \internal 8521 -
qaudiobuffer.h 5527 -
qaudiobuffer_support_p.h 3119 -
qaudiobufferinput.cpp ! \class QAudioBufferInput \inmodule QtMultimedia \ingroup multimedia \ingroup multimedia_audio \since 6.8 \brief The QAudioBufferInput class is used for providing custom audio buffers to \l QMediaRecorder through \l QMediaCaptureSession. QAudioBufferInput is only supported with the FFmpeg backend. \include qmediainput-pull-mode.qdocinc {pull-mode} {QAudioBufferInput} {audio buffer} {sendAudioBuffer} {readyToSendAudioBuffer} \snippet custommediainputsnippets/custommediainputsnippets.cpp QAudioBufferInput setup Here's a minimal implementation of the slot function that provides audio buffers: \snippet custommediainputsnippets/custommediainputsnippets.cpp nextAudioBuffer() For more details see readyToSendAudioBuffer() and sendAudioBuffer(). \sa QMediaRecorder and QMediaCaptureSession. 6439 -
qaudiobufferinput.h 1202 -
qaudiobufferoutput.cpp ! \class QAudioBufferOutput \inmodule QtMultimedia \ingroup multimedia \ingroup multimedia_audio \since 6.8 \brief The QAudioBufferOutput class is used for capturing audio data provided by \l QMediaPlayer. QAudioBufferOutput can be set to QMediaPlayer in order to receive audio buffers decoded by the media player. The received audio data can be used for any processing or visualization. An audio level meter implementation can be seen in the widget based \l{Media Player Example}. QAudioBufferOutput is only supported with the FFmpeg backend. \sa QMediaPlayer, QMediaPlayer::setAudioBufferOutput, QAudioBuffer 2421 -
qaudiobufferoutput.h 892 -
qaudiobufferoutput_p.h 1159 -
qaudiodecoder.cpp ! \class QAudioDecoder \brief The QAudioDecoder class implements decoding audio. \inmodule QtMultimedia \ingroup multimedia \ingroup multimedia_audio \preliminary The QAudioDecoder class is a high level class for decoding audio media files. It is similar to the QMediaPlayer class except that audio is provided back through this API rather than routed directly to audio hardware. \sa QAudioBuffer 10640 -
qaudiodecoder.h 2056 -
qaudiodecoder_p.h 993 -
qaudiodevice.cpp ! \class QAudioDevice \brief The QAudioDevice class provides an information about audio devices and their functionality. \inmodule QtMultimedia \ingroup multimedia \ingroup multimedia_audio QAudioDevice describes an audio device available in the system, either for input or for playback. A QAudioDevice is used by Qt to construct classes that communicate with the device -- such as QAudioSource, and QAudioSink. It is also used to determine the input or output device to use in a capture session or during media playback. \include qdevice-retains-properties.qdocinc {retains-properties} {QAudioDevice} {QMediaDevices} You can also query each device for the formats it supports. A format in this context is a set consisting of a channel count, sample rate, and sample type. A format is represented by the QAudioFormat class. The values supported by the device for each of these parameters can be fetched with minimumChannelCount(), maximumChannelCount(), minimumSampleRate(), maximumSampleRate() and supportedSampleFormats(). The combinations supported are dependent on the audio device capabilities. If you need a specific format, you can check if the device supports it with isFormatSupported(). For instance: \snippet multimedia-snippets/audio.cpp Audio output setup The set of available devices can be retrieved from the QMediaDevices class. For instance: \snippet multimedia-snippets/audio.cpp Dumping audio formats In this code sample, we loop through all devices that are able to output sound, i.e., play an audio stream in a supported format. For each device we find, we simply print the deviceName(). \sa QAudioSink, QAudioSource, QAudioFormat 14097 -
qaudiodevice.h 2437 -
qaudiodevice_p.h 4684 -
qaudioformat.cpp ! \class QAudioFormat \brief The QAudioFormat class stores audio stream parameter information. \inmodule QtMultimedia \ingroup multimedia \ingroup multimedia_audio An audio format specifies how data in a raw audio stream is arranged. For example, how the stream is to be interpreted. QAudioFormat contains parameters that specify how the audio sample data is arranged. These are the frequency, the number of channels, and the sample format. The following table describes these in more detail. \table \header \li Parameter \li Description \row \li Sample Rate \li Samples per second of audio data in Hertz. \row \li Number of channels \li The number of audio channels (typically one for mono or two for stereo). These are the amount of consecutive samples that together form one frame in the stream \row \li Sample format \li The format of the audio samples in the stream \endtable This class is used in conjunction with QAudioSource or QAudioSink to allow you to specify the parameters of the audio stream being read or written, or with QAudioBuffer when dealing with samples in memory. You can obtain audio formats compatible with the audio device used through functions in QAudioDevice. This class also lets you query available parameter values for a device, so that you can set the parameters yourself. See the \l QAudioDevice class description for details. You need to know the format of the audio streams you wish to play or record. Samples for all channels will be interleaved. One sample for each channel for the same instant in time is referred to as a frame in Qt Multimedia (and other places). 14170 -
qaudioformat.h 5449 -
qaudioformat_p.h 1776 -
qaudiohelpers.cpp __restrict__ 30156 -
qaudiohelpers_p.h 5437 -
qaudioinput.cpp ! \qmltype AudioInput \nativetype QAudioInput \brief An audio input to be used for capturing audio in a capture session. \inqmlmodule QtMultimedia \ingroup multimedia_qml \ingroup multimedia_audio_qml \qml CaptureSession { id: playMusic audioInput: AudioInput { volume: slider.value } recorder: MediaRecorder { ... } } Slider { id: slider from: 0. to: 1. } \endqml You can use AudioInput together with a QtMultiMedia::CaptureSession to capture audio from an audio input device. \sa Camera, AudioOutput 5284 -
qaudioinput.h 1512 -
qaudiooutput.cpp ! \qmltype AudioOutput \nativetype QAudioOutput \brief An audio output to be used for playback or monitoring of a capture session. \inqmlmodule QtMultimedia \ingroup multimedia_qml \ingroup multimedia_audio_qml \qml MediaPlayer { id: playMusic source: "music.wav" audioOutput: AudioOutput { volume: slider.value } } Slider { id: slider from: 0. to: 1. } \endqml You can use AudioOutput together with a \l{QtMultimedia::MediaPlayer}{MediaPlayer} to play audio content, or you can use it in conjunction with a \l{QtMultimedia::CaptureSession}{CaptureSession} to monitor the audio processed by the capture session. \sa VideoOutput, AudioInput 6561 -
qaudiooutput.h 1550 -
qaudioringbuffer_p.h elements 7422 -
qaudiosink.cpp ! \class QAudioSink \brief The QAudioSink class provides an interface for sending audio data to an audio output device. \inmodule QtMultimedia \ingroup multimedia \ingroup multimedia_audio You can construct an audio output with the system's default audio output device. It is also possible to create QAudioSink with a specific QAudioDevice. When you create the audio output, you should also send in the QAudioFormat to be used for the playback (see the QAudioFormat class description for details). QAudioSink can be used in two different modes: \list \li Using a QIODevice from an application thread \li Using a callback-based interface from the audio thread \endlist \section1 QIODevice interface Starting to play an audio stream is simply a matter of calling start() with a QIODevice. QAudioSink will then fetch the data it needs from the io device. So playing back an audio file is as simple as: \snippet multimedia-snippets/audio.cpp Audio output class members \snippet multimedia-snippets/audio.cpp Audio output setup The file will start playing assuming that the audio system and output device support it. If you run out of luck, check what's up with the error() function. After the file has finished playing, we need to stop the device: \snippet multimedia-snippets/audio.cpp Audio output stop At any given time, the QAudioSink will be in one of four states: active, suspended, stopped, or idle. These states are described by the QtAudio::State enum. \section2 Threading model and buffering The QIODevice interface is designed to be used from the application thread. A wait-free ringbuffer is used to communicate to the audio thread. The size of this ringbuffer can be configured with setBufferSize() and defaults to 250ms. The state of this buffer can be queried with bytesFree(). If the ringbuffer runs out of data, the audio thread will send silence to the audio device and the state will change to QtAudio::IdleState and resume to QtAudio::ActiveState when more data is available from the QIODevice. \section1 Callback interface The preferred way to achieve low audio latency is to use the callback-based interface. It allows you to write audio data directly to the audio device without having to go through a QIODevice. This is done by calling start() with a callback function that will be called from the audio thread. This callback function will be called with a QSpan<SampleType> whenever the audio backend requires data. \snippet multimedia-snippets/audio.cpp Audio callback output class members \snippet multimedia-snippets/audio.cpp Audio callback output setup sine Unlike the QIODevice-based interface, the QAudioSink can only be in the states active, suspendend and stopped. The setBufferSize() API is not available when using the callback, the size of the callback argument is determined by the audio backend. \qtmmaudiocallbacksupportednote \qtmmaudiocallbacknote \section1 State and error handling State changes are reported through the stateChanged() signal. You can use this signal to, for instance, update the GUI of the application; the mundane example here being changing the state of a \c { play/pause } button. You request a state change directly with suspend(), stop(), reset(), resume(), and start(). The QAudioSink will enter the \l{QtAudio::}{StoppedState} when an error is encountered. The \l{QtAudio::Error}{error type} can be retrieved with the error() function. Please see the QtAudio::Error enum for a description of the possible errors that are reported. Calling stop() or reset() will reset the error state to \l{QtAudio::Error}{NoError}. You can check for errors by connecting to the stateChanged() signal: \snippet multimedia-snippets/audio.cpp Audio output state changed \sa QAudioSource, QAudioDevice 19002 -
qaudiosink.h 2708 -
qaudiosource.cpp 19261 -
qaudiosource.h 2738 -
qaudiosystem.cpp 3248 -
qaudiosystem_p.h 17800 -
qaudiosystem_platform_stream_support.cpp 18600 -
qaudiosystem_platform_stream_support_p.h 10649 -
qdrawavaudiodecoder.cpp 12457 -
qdrawavaudiodecoder_p.h 4316 -
qmemory_resource_tlsf.cpp 1533 -
qmemory_resource_tlsf_p.h 1628 -
qrtaudioengine.cpp 11438 -
qrtaudioengine_p.h 9891 -
qsamplecache_p.cpp 22553 -
qsamplecache_p.h 5185 -
qsoundeffect.cpp ! \class QSoundEffect \brief The QSoundEffect class provides a way to play low latency sound effects. \ingroup multimedia \ingroup multimedia_audio \inmodule QtMultimedia This class allows you to play uncompressed audio files (typically WAV files) in a generally lower latency way, and is suitable for "feedback" type sounds in response to user actions (e.g. virtual keyboard sounds, positive or negative feedback for popup dialogs, or game sounds). If low latency is not important, consider using the QMediaPlayer class instead, since it supports a wider variety of media formats and is less resource intensive. This example shows how a looping, somewhat quiet sound effect can be played: \snippet multimedia-snippets/qsound.cpp 2 Typically the sound effect should be reused, which allows all the parsing and preparation to be done ahead of time, and only triggered when necessary. This assists with lower latency audio playback. \snippet multimedia-snippets/qsound.cpp 3 Since QSoundEffect requires slightly more resources to achieve lower latency playback, the platform may limit the number of simultaneously playing sound effects. 17018 -
qsoundeffect.h 2586 -
qsoundeffect_p.h 2041 -
qsoundeffectsynchronous.cpp 11413 -
qsoundeffectsynchronous_p.h 2715 -
qsoundeffectwithplayer.cpp 17711 -
qsoundeffectwithplayer_p.h 4807 -
qtaudio.cpp ! \namespace QtAudio \ingroup multimedia-namespaces \brief The QtAudio namespace contains enums used by the audio classes. \inmodule QtMultimedia \ingroup multimedia \ingroup multimedia_audio 9090 -
qtaudio.h 4023 -
qwavedecoder.cpp device 11686 -
qwavedecoder.h 2723 -