Home · All Namespaces · All Classes · Grouped Classes · Modules · Functions |
The QAudioOutput class provides an interface for sending live audio samples to the default audio output device. More...
#include <QAudioOutput>
Inherits QIODevice.
The QAudioOutput class provides an interface for sending live audio samples to the default audio output device.
The QAudioOutput class provides an interface for sending live audio samples to the default output device. It is intended for use by media streaming applications that can produce a stream of 8-bit unsigned or 16-bit signed audio samples. The sound output will be mixed with audio data from other applications.
The usual sequence for opening the default audio output device is as follows:
QAudioOutput *audio = new QAudioOutput(); audio->setFrequency( 11025 ); audio->setChannels( 1 ); audio->setBitsPerSample( 8 ); audio->open( QIODevice::WriteOnly );
See also QAudioInput.
Construct a new audio output stream and attach it to parent. The default parameters are 44100 Hz Stereo, with 16-bit samples.
Construct a new audio output stream and attach it to parent. The default parameters are 44100 Hz Stereo, with 16-bit samples.
The device parameter is implementation-specific, and might not be honored by all implementations. It is usually an Alsa device name such as plughw:0,0. The string default can be passed for device if the client application wishes to use the default device and is not concerned with what that default device may be called.
Destroy this audio output stream.
Returns the number of bits per sample (8 or 16). If the value is 16, the samples must be signed and in host byte order. If bitsPerSample() is 8, the samples must be unsigned.
See also setBitsPerSample().
Returns the number of playback channels. The default value is 2.
See also setChannels().
Closes this audio output stream.
Reimplemented from QIODevice.
Returns the current frequency of audio samples. The default value is 44100.
See also setFrequency().
Determines if this QIODevice is sequential. Always returns true.
Reimplemented from QIODevice.
Opens this audio output stream in mode. Returns true if the audio output stream could be opened; false otherwise.
Reads up to maxlen bytes into data. Not used for audio output devices.
Reimplemented from QIODevice.
Sets the number of bits per sample to value (8 or 16). Should be called before open(). If the value is 16, the samples must be signed and in host byte order. If bitsPerSample() is 8, the samples must be unsigned.
See also bitsPerSample().
Sets the number of playback channels to value. Should be called before open().
See also channels().
Sets the frequency of audio samples to value. Should be called before open().
See also frequency().
Writes len bytes from data to the audio output stream.
If bitsPerSample() is 16, the samples must be signed and in host byte order. If bitsPerSample() is 8, the samples must be unsigned.
Reimplemented from QIODevice.
Copyright © 2009 Trolltech | Trademarks | Qt Extended 4.4.3 |