Add optional resampling of the output stream

This commit is contained in:
badaix 2020-02-14 08:46:13 +01:00
parent 549fcba40f
commit 3fc8b9ca08
8 changed files with 185 additions and 98 deletions

View file

@ -84,7 +84,6 @@ int main(int argc, char** argv)
ClientSettings settings;
string pcm_device("default");
OptionParser op("Allowed options");
auto helpSwitch = op.add<Switch>("", "help", "produce help message");
auto groffSwitch = op.add<Switch, Attribute::hidden>("", "groff", "produce groff message");
@ -106,6 +105,7 @@ int main(int argc, char** argv)
/*auto instanceValue =*/op.add<Value<size_t>>("i", "instance", "instance id", 1, &settings.instance);
/*auto hostIdValue =*/op.add<Value<string>>("", "hostID", "unique host id", "", &settings.host_id);
op.add<Value<string>>("", "player", "audio backend", "", &settings.player.player_name);
auto sample_format = op.add<Value<string>>("", "sampleformat", "resample audio stream to sampleformat", "");
try
{
@ -210,6 +210,11 @@ int main(int argc, char** argv)
}
#endif
if (sample_format->is_set())
{
settings.player.sample_format = SampleFormat(sample_format->value());
}
bool active = true;
std::shared_ptr<Controller> controller;
auto signal_handler = install_signal_handler({SIGHUP, SIGTERM, SIGINT},