mirror of
https://github.com/overte-org/overte.git
synced 2025-04-08 04:52:46 +02:00
Initialize AudioClient properties earlier.
This commit is contained in:
parent
cba6f29f77
commit
e55a2ff6f3
1 changed files with 12 additions and 0 deletions
|
@ -320,6 +320,18 @@ AudioClient::AudioClient() {
|
|||
// avoid putting a lock in the device callback
|
||||
assert(_localSamplesAvailable.is_lock_free());
|
||||
|
||||
// Set up the desired audio format, since scripting API expects it to be set and audio scripting API
|
||||
// is initialized before audio thread starts.
|
||||
_desiredInputFormat.setSampleRate(AudioConstants::SAMPLE_RATE);
|
||||
_desiredInputFormat.setSampleSize(16);
|
||||
_desiredInputFormat.setCodec("audio/pcm");
|
||||
_desiredInputFormat.setSampleType(QAudioFormat::SignedInt);
|
||||
_desiredInputFormat.setByteOrder(QAudioFormat::LittleEndian);
|
||||
_desiredInputFormat.setChannelCount(1);
|
||||
|
||||
_desiredOutputFormat = _desiredInputFormat;
|
||||
_desiredOutputFormat.setChannelCount(OUTPUT_CHANNEL_COUNT);
|
||||
|
||||
// deprecate legacy settings
|
||||
{
|
||||
Setting::Handle<int>::Deprecated("maxFramesOverDesired", InboundAudioStream::MAX_FRAMES_OVER_DESIRED);
|
||||
|
|
Loading…
Reference in a new issue