mirror of
https://github.com/danog/libtgvoip.git
synced 2024-11-30 04:39:03 +01:00
VoIP fixes
This commit is contained in:
parent
1d7509e838
commit
e6211103f0
@ -91,6 +91,7 @@ enum
|
||||
|
||||
enum
|
||||
{
|
||||
STATE_CREATED = 0,
|
||||
STATE_WAIT_INIT = 1,
|
||||
STATE_WAIT_INIT_ACK,
|
||||
STATE_ESTABLISHED,
|
||||
|
@ -41,11 +41,11 @@ tgvoip::OpusEncoder::OpusEncoder(const std::shared_ptr<MediaStreamItf> &source,
|
||||
this->source = source;
|
||||
source->SetCallback(tgvoip::OpusEncoder::Callback, this);
|
||||
|
||||
enc = opus_encoder_create(48000, 1, OPUS_APPLICATION_VOIP, NULL);
|
||||
enc = opus_encoder_create(48000, 1, OPUS_APPLICATION_AUDIO, NULL);
|
||||
opus_encoder_ctl(enc, OPUS_SET_COMPLEXITY(10));
|
||||
opus_encoder_ctl(enc, OPUS_SET_PACKET_LOSS_PERC(1));
|
||||
opus_encoder_ctl(enc, OPUS_SET_INBAND_FEC(1));
|
||||
opus_encoder_ctl(enc, OPUS_SET_SIGNAL(OPUS_SIGNAL_VOICE));
|
||||
opus_encoder_ctl(enc, OPUS_SET_SIGNAL(OPUS_SIGNAL_MUSIC));
|
||||
opus_encoder_ctl(enc, OPUS_SET_BANDWIDTH(OPUS_AUTO));
|
||||
opus_encoder_ctl(enc, OPUS_SET_BITRATE(OPUS_AUTO));
|
||||
requestedBitrate = 20000;
|
||||
@ -66,7 +66,7 @@ tgvoip::OpusEncoder::OpusEncoder(const std::shared_ptr<MediaStreamItf> &source,
|
||||
{
|
||||
secondaryEncoder = opus_encoder_create(48000, 1, OPUS_APPLICATION_VOIP, NULL);
|
||||
opus_encoder_ctl(secondaryEncoder, OPUS_SET_COMPLEXITY(10));
|
||||
opus_encoder_ctl(secondaryEncoder, OPUS_SET_SIGNAL(OPUS_SIGNAL_VOICE));
|
||||
opus_encoder_ctl(secondaryEncoder, OPUS_SET_SIGNAL(OPUS_SIGNAL_MUSIC));
|
||||
opus_encoder_ctl(secondaryEncoder, OPUS_SET_BITRATE(currentSecondaryBitrate));
|
||||
}
|
||||
else
|
||||
|
Loading…
Reference in New Issue
Block a user