• PySide 模块
  • PySide.QtMultimedia
  • 内容表

    上一话题

    QAudioDeviceInfo

    下一话题

    QVideoFrame

    QAudioFormat

    概要

    函数

    详细描述

    PySide.QtMultimedia.QAudioFormat class stores audio parameter information.

    An audio format specifies how data in an audio stream is arranged, i.e, how the stream is to be interpreted. The encoding itself is specified by the PySide.QtMultimedia.QAudioFormat.codec() used for the stream.

    In addition to the encoding, PySide.QtMultimedia.QAudioFormat contains other parameters that further specify how the audio data is arranged. These are the frequency, the number of channels, the sample size, the sample type, and the byte order. The following table describes these in more detail.

    Parameter 描述
    Sample Rate Samples per second of audio data in Hertz.
    Number of channels The number of audio channels (typically one for mono or two for stereo)
    Sample size How much data is stored in each sample (typically 8 or 16 bits)
    Sample type Numerical representation of sample (typically signed integer, unsigned integer or float)
    Byte order Byte ordering of sample (typically little endian, big endian)

    You can obtain audio formats compatible with the audio device used through functions in PySide.QtMultimedia.QAudioDeviceInfo . This class also lets you query available parameter values for a device, so that you can set the parameters yourself. See the PySide.QtMultimedia.QAudioDeviceInfo class description for details. You need to know the format of the audio streams you wish to play. Qt does not set up formats for you.

    class PySide.QtMultimedia. QAudioFormat
    class PySide.QtMultimedia. QAudioFormat ( other )
    参数: other PySide.QtMultimedia.QAudioFormat

    Construct a new audio format.

    Values are initialized as follows:

    Construct a new audio format using other .

    PySide.QtMultimedia.QAudioFormat. SampleType
    常量 描述
    QAudioFormat.Unknown Not Set
    QAudioFormat.SignedInt samples are signed integers
    QAudioFormat.UnSignedInt samples are unsigned intergers
    QAudioFormat.Float samples are floats
    PySide.QtMultimedia.QAudioFormat. Endian
    常量 描述
    QAudioFormat.BigEndian samples are big endian byte order
    QAudioFormat.LittleEndian samples are little endian byte order
    PySide.QtMultimedia.QAudioFormat. byteOrder ( )
    返回类型: PySide.QtMultimedia.QAudioFormat.Endian

    Returns the current byteOrder value.

    PySide.QtMultimedia.QAudioFormat. channelCount ( )
    返回类型: PySide.QtCore.int

    Returns the current channel count value.

    PySide.QtMultimedia.QAudioFormat. channels ( )
    返回类型: PySide.QtCore.int

    使用 PySide.QtMultimedia.QAudioFormat.channelCount() 代替。

    PySide.QtMultimedia.QAudioFormat. codec ( )
    返回类型: unicode

    Returns the current codec value.

    PySide.QtMultimedia.QAudioFormat. frequency ( )
    返回类型: PySide.QtCore.int

    使用 PySide.QtMultimedia.QAudioFormat.sampleRate() 代替。

    PySide.QtMultimedia.QAudioFormat. isValid ( )
    返回类型: PySide.QtCore.bool

    Returns true if all of the parameters are valid.

    PySide.QtMultimedia.QAudioFormat. __ne__ ( other )
    参数: other PySide.QtMultimedia.QAudioFormat
    返回类型: PySide.QtCore.bool

    返回 true,若此 PySide.QtMultimedia.QAudioFormat is not equal to the other PySide.QtMultimedia.QAudioFormat ;否则返回 false。

    All elements of PySide.QtMultimedia.QAudioFormat are used for the comparison.

    PySide.QtMultimedia.QAudioFormat. __eq__ ( other )
    参数: other PySide.QtMultimedia.QAudioFormat
    返回类型: PySide.QtCore.bool

    返回 true,若此 PySide.QtMultimedia.QAudioFormat is equal to the other PySide.QtMultimedia.QAudioFormat ;否则返回 false。

    All elements of PySide.QtMultimedia.QAudioFormat are used for the comparison.

    PySide.QtMultimedia.QAudioFormat. sampleRate ( )
    返回类型: PySide.QtCore.int

    Returns the current sample rate in Hertz.

    PySide.QtMultimedia.QAudioFormat. sampleSize ( )
    返回类型: PySide.QtCore.int

    Returns the current sample size value.

    PySide.QtMultimedia.QAudioFormat. sampleType ( )
    返回类型: PySide.QtMultimedia.QAudioFormat.SampleType

    返回当前 QAudioFormat.SampleType 值。

    PySide.QtMultimedia.QAudioFormat. setByteOrder ( byteOrder )
    参数: byteOrder PySide.QtMultimedia.QAudioFormat.Endian
    PySide.QtMultimedia.QAudioFormat. setChannelCount ( channelCount )
    参数: channelCount PySide.QtCore.int

    Sets the channel count to channels .

    PySide.QtMultimedia.QAudioFormat. setChannels ( channels )
    参数: channels PySide.QtCore.int

    使用 PySide.QtMultimedia.QAudioFormat.setChannelCount() 代替。

    PySide.QtMultimedia.QAudioFormat. setCodec ( codec )
    参数: codec – unicode

    Sets the codec to codec .

    PySide.QtMultimedia.QAudioFormat. setFrequency ( frequency )
    参数: frequency PySide.QtCore.int

    使用 PySide.QtMultimedia.QAudioFormat.setSampleRate() 代替。

    PySide.QtMultimedia.QAudioFormat. setSampleRate ( sampleRate )
    参数: sampleRate PySide.QtCore.int

    Sets the sample rate to samplerate Hertz.

    PySide.QtMultimedia.QAudioFormat. setSampleSize ( sampleSize )
    参数: sampleSize PySide.QtCore.int

    Sets the sample size to the sampleSize 指定。

    PySide.QtMultimedia.QAudioFormat. setSampleType ( sampleType )
    参数: sampleType PySide.QtMultimedia.QAudioFormat.SampleType