-
Notifications
You must be signed in to change notification settings - Fork 176
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve audio settings #1582
base: master
Are you sure you want to change the base?
Improve audio settings #1582
Changes from all commits
0613b8e
7aae31f
b86cb4a
bc0c822
b4abd5e
76c8c1a
81dfff7
aa99c37
cb62e3f
8652168
9b06c90
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -24,6 +24,7 @@ | |||||
|
||||||
#include "AudioMixerStats.h" | ||||||
#include "AudioMixerSlavePool.h" | ||||||
#include "plugins/CodecPlugin.h" | ||||||
|
||||||
class PositionalAudioStream; | ||||||
class AvatarAudioStream; | ||||||
|
@@ -52,13 +53,27 @@ class AudioMixer : public ThreadedAssignment { | |||||
float wetLevel; | ||||||
}; | ||||||
|
||||||
/* | ||||||
struct CodecSettings { | ||||||
QString codec; | ||||||
Encoder::Bandpass bandpass = Encoder::Bandpass::Fullband; | ||||||
Encoder::ApplicationType applicationType = Encoder::ApplicationType::Audio; | ||||||
Encoder::SignalType signalType = Encoder::SignalType::Auto; | ||||||
int bitrate = 128000; | ||||||
int complexity = 100; | ||||||
bool enableFEC = 0; | ||||||
int packetLossPercent = 0; | ||||||
bool enableVBR = 1; | ||||||
}; | ||||||
*/ | ||||||
static int getStaticJitterFrames() { return _numStaticJitterFrames; } | ||||||
static bool shouldMute(float quietestFrame) { return quietestFrame > _noiseMutingThreshold; } | ||||||
static float getAttenuationPerDoublingInDistance() { return _attenuationPerDoublingInDistance; } | ||||||
static const std::vector<ZoneDescription>& getAudioZones() { return _audioZones; } | ||||||
static const std::vector<ZoneSettings>& getZoneSettings() { return _zoneSettings; } | ||||||
static const std::vector<ReverbSettings>& getReverbSettings() { return _zoneReverbSettings; } | ||||||
static const std::pair<QString, CodecPluginPointer> negotiateCodec(std::vector<QString> codecs); | ||||||
static const std::vector<Encoder::CodecSettings> getCodecSettings() { return _codecSettings; } | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I guess this comes from the line above, but return const value seems odd, unless I'm missing some coding standard. Hard to think of any actual use cases for it though in general, outside of some really weird proxy types maybe.
Suggested change
I would change negotiateCodec as well to return a plain value without const, but that would be out of scope of this PR. |
||||||
|
||||||
static bool shouldReplicateTo(const Node& from, const Node& to) { | ||||||
return to.getType() == NodeType::DownstreamAudioMixer && | ||||||
|
@@ -67,7 +82,7 @@ class AudioMixer : public ThreadedAssignment { | |||||
} | ||||||
|
||||||
virtual void aboutToFinish() override; | ||||||
|
||||||
public slots: | ||||||
void run() override; | ||||||
void sendStatsPacket() override; | ||||||
|
@@ -149,6 +164,7 @@ private slots: | |||||
static std::vector<ZoneDescription> _audioZones; | ||||||
static std::vector<ZoneSettings> _zoneSettings; | ||||||
static std::vector<ReverbSettings> _zoneReverbSettings; | ||||||
static std::vector<Encoder::CodecSettings> _codecSettings; | ||||||
|
||||||
float _throttleStartTarget = 0.9f; | ||||||
float _throttleBackoffTarget = 0.44f; | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1277,7 +1277,7 @@ | |
{ | ||
"name": "audio_env", | ||
"label": "Audio Environment", | ||
"assignment-types": [ 0 ], | ||
"assignment-types": [ 0, 5 ], | ||
"settings": [ | ||
{ | ||
"name": "attenuation_per_doubling_in_distance", | ||
|
@@ -1417,10 +1417,109 @@ | |
{ | ||
"name": "codec_preference_order", | ||
"label": "Audio Codec Preference Order", | ||
"help": "List of codec names in order of preferred usage", | ||
"help": "List of codec names in order of preferred usage -- mod2", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I can't figure out what mod2 means here... |
||
"placeholder": "opus, hifiAC, zlib, pcm", | ||
"default": "opus,hifiAC,zlib,pcm", | ||
"advanced": true | ||
}, | ||
{ | ||
"name": "codec_settings", | ||
"label": "Audio Codec Settings", | ||
"help": "Advanced settings for audio codecs", | ||
"advanced": true, | ||
"type": "table", | ||
"numbered": false, | ||
"content_setting": false, | ||
"can_add_new_rows": true, | ||
"columns" : [ | ||
{ | ||
"name": "codec", | ||
"label": "Codec", | ||
"can_set": true, | ||
"placeholder": "(codec)", | ||
"editable": false | ||
}, | ||
{ | ||
"name": "complexity", | ||
"label": "Complexity", | ||
"can_set": true, | ||
"type": "int", | ||
"placeholder": "(percentage)", | ||
"default": 0, | ||
"editable": true | ||
}, | ||
{ | ||
"name": "bitrate", | ||
"label": "Bitrate", | ||
"can_set": true, | ||
"type": "int", | ||
"placeholder": "(bps)", | ||
"default" : 0, | ||
"editable": true | ||
}, | ||
{ | ||
"name": "vbr", | ||
"label": "Variable Bitrate", | ||
"can_set": true, | ||
"type": "checkbox", | ||
"default": false, | ||
"editable": true | ||
}, | ||
{ | ||
"name": "fec", | ||
"label": "Error correction", | ||
"can_set": true, | ||
"type": "checkbox", | ||
"default" : false, | ||
"editable": true | ||
}, | ||
{ | ||
"name": "packet_loss", | ||
"label": "Expected loss %", | ||
"can_set": true, | ||
"type": "int", | ||
"placeholder": "(percentage)", | ||
"default": 0, | ||
"editable": true | ||
} | ||
|
||
], | ||
"non-deletable-row-key": "codec", | ||
"non-deletable-row-values": [ "pcm", "zlib", "hifiAC", "opus" ], | ||
"default": [ | ||
{ | ||
"codec": "pcm", | ||
"complexity": 0, | ||
"bitrate": 0, | ||
"vbr": false, | ||
"fec": false, | ||
"packet_loss": 0 | ||
}, | ||
{ | ||
"codec": "zlib", | ||
"complexity": 6, | ||
"bitrate": 0, | ||
"vbr": false, | ||
"fec": false, | ||
"packet_loss": 0 | ||
}, | ||
{ | ||
"codec": "hifiAC", | ||
"complexity": 0, | ||
"bitrate": 0, | ||
"vbr": false, | ||
"fec": false, | ||
"packet_loss": 0 | ||
}, | ||
{ | ||
"codec": "opus", | ||
"complexity": 10, | ||
"bitrate": 128000, | ||
"vbr": true, | ||
"fec": false, | ||
"packet_loss": 0 | ||
} | ||
] | ||
} | ||
] | ||
}, | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is identical to the definition in the included plugins/CodecPlugin.h, not sure if it's here for reference, but seems out of place anyway