equal
deleted
inserted
replaced
58 fmt.setSampleType(QT_PREPEND_NAMESPACE(QAudioFormat)::SignedInt); |
58 fmt.setSampleType(QT_PREPEND_NAMESPACE(QAudioFormat)::SignedInt); |
59 fmt.setCodec("audio/pcm"); |
59 fmt.setCodec("audio/pcm"); |
60 fmt.setByteOrder(QAudioFormat::LittleEndian); |
60 fmt.setByteOrder(QAudioFormat::LittleEndian); |
61 m_session->setFormat(fmt); |
61 m_session->setFormat(fmt); |
62 |
62 |
63 m_settings.setEncodingMode(QtMedia::ConstantQualityEncoding); |
63 m_settings.setEncodingMode(QtMediaServices::ConstantQualityEncoding); |
64 m_settings.setCodec("audio/pcm"); |
64 m_settings.setCodec("audio/pcm"); |
65 m_settings.setBitRate(8000); |
65 m_settings.setBitRate(8000); |
66 m_settings.setChannelCount(1); |
66 m_settings.setChannelCount(1); |
67 m_settings.setSampleRate(8000); |
67 m_settings.setSampleRate(8000); |
68 m_settings.setQuality(QtMedia::LowQuality); |
68 m_settings.setQuality(QtMediaServices::LowQuality); |
69 } |
69 } |
70 |
70 |
71 AudioEncoderControl::~AudioEncoderControl() |
71 AudioEncoderControl::~AudioEncoderControl() |
72 { |
72 { |
73 } |
73 } |
128 |
128 |
129 void AudioEncoderControl::setAudioSettings(const QAudioEncoderSettings &settings) |
129 void AudioEncoderControl::setAudioSettings(const QAudioEncoderSettings &settings) |
130 { |
130 { |
131 QAudioFormat fmt = m_session->format(); |
131 QAudioFormat fmt = m_session->format(); |
132 |
132 |
133 if (settings.encodingMode() == QtMedia::ConstantQualityEncoding) { |
133 if (settings.encodingMode() == QtMediaServices::ConstantQualityEncoding) { |
134 if (settings.quality() == QtMedia::LowQuality) { |
134 if (settings.quality() == QtMediaServices::LowQuality) { |
135 fmt.setSampleSize(8); |
135 fmt.setSampleSize(8); |
136 fmt.setChannels(1); |
136 fmt.setChannels(1); |
137 fmt.setFrequency(8000); |
137 fmt.setFrequency(8000); |
138 fmt.setSampleType(QAudioFormat::UnSignedInt); |
138 fmt.setSampleType(QAudioFormat::UnSignedInt); |
139 |
139 |
140 } else if (settings.quality() == QtMedia::NormalQuality) { |
140 } else if (settings.quality() == QtMediaServices::NormalQuality) { |
141 fmt.setSampleSize(16); |
141 fmt.setSampleSize(16); |
142 fmt.setChannels(1); |
142 fmt.setChannels(1); |
143 fmt.setFrequency(22050); |
143 fmt.setFrequency(22050); |
144 fmt.setSampleType(QAudioFormat::SignedInt); |
144 fmt.setSampleType(QAudioFormat::SignedInt); |
145 |
145 |