Merge generic part of Android microphone changes (#5624)
This commit is contained in:
parent
e6ef00b41d
commit
5f1eb7146d
5 changed files with 61 additions and 9 deletions
|
@ -86,7 +86,7 @@ void CubebInput::StartSampling(const Frontend::Mic::Parameters& params) {
|
|||
input_params.format = CUBEB_SAMPLE_S16LE;
|
||||
input_params.rate = params.sample_rate;
|
||||
|
||||
u32 latency_frames;
|
||||
u32 latency_frames = 512; // Firefox default
|
||||
if (cubeb_get_min_latency(impl->ctx, &input_params, &latency_frames) != CUBEB_OK) {
|
||||
LOG_ERROR(Audio, "Could not get minimum latency");
|
||||
}
|
||||
|
@ -189,4 +189,11 @@ std::vector<std::string> ListCubebInputDevices() {
|
|||
cubeb_destroy(ctx);
|
||||
return device_list;
|
||||
}
|
||||
|
||||
CubebFactory::~CubebFactory() = default;
|
||||
|
||||
std::unique_ptr<Frontend::Mic::Interface> CubebFactory::Create(std::string mic_device_name) {
|
||||
return std::make_unique<CubebInput>(std::move(mic_device_name));
|
||||
}
|
||||
|
||||
} // namespace AudioCore
|
||||
|
|
|
@ -31,4 +31,11 @@ private:
|
|||
|
||||
std::vector<std::string> ListCubebInputDevices();
|
||||
|
||||
class CubebFactory final : public Frontend::Mic::RealMicFactory {
|
||||
public:
|
||||
~CubebFactory() override;
|
||||
|
||||
std::unique_ptr<Frontend::Mic::Interface> Create(std::string mic_device_name) override;
|
||||
};
|
||||
|
||||
} // namespace AudioCore
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue