mkckr0 / audio-share

Audio Share can share Windows/Linux computer's audio to Android phone over network, so your phone becomes the speaker of computer. (You needn't buy a new speaker😄.)
Apache License 2.0
874 stars 42 forks source link

[New Feature] Edit sample rate #45

Open airisama019 opened 7 months ago

airisama019 commented 7 months ago

Describe the new feature you'd like Edit sample rate through as-cmd parameter/option

example : as-cmd -b 192.168.x.x --sample-rate 96000

Describe the reason why you want to add the feature Increasing sample rate may lower latency since default is 48000

Additional context I tried changing pipewire.conf but as-cmd still reports 48000

hideki2k02 commented 7 months ago

Looking forward to this as latency can be quite the annoyance on certain scenarios.

UPDATE: Here are some comparisons:

mkckr0 commented 7 months ago

Increasing sample rate can't lower latency. It need more network traffic bandwidth, and may higher the latency. Instead, you need decrease the sample rate.

airisama019 commented 7 months ago

Looking forward to this as latency can be quite the annoyance on certain scenarios.

UPDATE: Here are some comparisons:

  • Phone is on a 5GHz 80Hz Wi-Fi and the PC is Wired: Very noticeable latency, probably over 15ms.
  • Phone is directly connected to the PC via USB (Using USB Tethering): ~5ms latency.

there is this "audio-sharing" app on flathub and it so much worse like 1 or 2 sec latency this one here is much better latency on videos is berable on 5 ghz wifi but you can't do gaming.

hideki2k02 commented 7 months ago

there is this "audio-sharing" app on flathub and it so much worse like 1 or 2 sec latency this one here is much better

Definitely! Unfortunately IIRC its Shareware and only works for 1h and its a pain to set-up :(

latency on videos is berable on 5 ghz wifi but you can't do gaming. I was able to get decent latency (probably 2-3ms) by doing this

  • Setting Buffer to 1x
  • Connecting a USB Cable from the Phone to the PC using USB Tethering (Dont forget to disable Mobile Data)
  • Connect using the IP the Phone gave you (Check the Network settings, should be something like 192.168.102.248)