StreamPack icon indicating copy to clipboard operation
StreamPack copied to clipboard

[Feat]: Set AudioRecord setPreferredDevice

Open TranNam68 opened this issue 9 months ago • 5 comments

Version

2.6.1

Environment that reproduces the issue

Redmi Note 9 Pro - Android 12

Use case description

Hi. How can I optionally set up audio sources for livestream: device microphone, bluetooth microphone, usb microphone,... ?

Proposed solution

No response

Alternative solutions

No response

TranNam68 avatar Mar 18 '25 09:03 TranNam68

Hi there,

I am working in v3 where setting the audio source is possible. Unfortunately, I don't plan to add new audio source yet (I am just implementing the possibility to set a new audio source).

For my experience, BT microphone is always a bad idea because of the latency (unless there is low latency BT now).

ThibaultBee avatar Mar 18 '25 15:03 ThibaultBee

Hi there,

I am working in v3 where setting the audio source is possible. Unfortunately, I don't plan to add new audio source yet (I am just implementing the possibility to set a new audio source).

For my experience, BT microphone is always a bad idea because of the latency (unless there is low latency BT now).

Hi, Yes, I just need the ability to set the audio source as AudioDeviceInfo of AudioRecord class. Maybe something like this: public boolean setPreferredDevice(AudioDeviceInfo deviceInfo)

In the current version (2.6.1), can I add/modify code to do that? Thanks.

TranNam68 avatar Mar 18 '25 15:03 TranNam68

You can modify directly in the dev_v3 branch.

With v3, there is internal and public interfaces for most of the components (incl. source). So you will have to add an API to the public IAudioRecordSource interface and implements it in AudioRecordSource.

Somehow, you have to make sure audio config (sample rates, byte format,...) is valid with current configuration.

ThibaultBee avatar Mar 18 '25 16:03 ThibaultBee

Thank you very much. I will check it out.

TranNam68 avatar Mar 20 '25 08:03 TranNam68

Have you made progress? You can made a PR when the dev is done 👍

ThibaultBee avatar Apr 01 '25 15:04 ThibaultBee