rom1v / usbaudio

Forward audio from Android devices
MIT License
350 stars 32 forks source link

is there any way i can use this on windows? #28

Open pranshuthegamer opened 3 years ago

pranshuthegamer commented 3 years ago

i want to use this on windows but i have android 7.1.2

rom1v commented 3 years ago

No.

djalilhebal commented 3 years ago

Yesterday, I tested this project on Linux (Ubuntu 18.04 x64) and found it to be useful. I personally didn't need to play audio from my phone, but to use it as a microphone, so I ended up using @bitplane's Microphone and your program (usbaudio --no-play --device 04e8:6860).

I wanted to share it with my Windows-using fellow students and thought of the following:

This program depends on libusb (which is cross-platform) and libpulse (Linux-only, AFAIK), while others are either cross-platform or have been ported (e.g. getopt.h as in this Stack Overflow answer).

  1. When building for/on Windows, you could (conditionally) remove PulseAudio's stuff (i.e. pulse.h, pulse.c, and its dependency entry from meson.build) and replace int pulse_get_device_number(const char *serial)) with a no-op function that simply returns -1 (the error code).

  2. Windows users should just run usbaudio with the --no-play option. (We just need it to enable audio forwarding.)

  3. Finally, Windows users should feed audio from the new "USB audio input device" (the Android phone in accessory mode) to their speakers or headsets. (It is possible to do this natively since at least Windows 7 as mentioned in Super User, and the same method works on Windows 10 as shown in this video.)

PS: Perhaps the third step can be automated.

What do you think, @rom1v ?

pranshuthegamer commented 3 years ago

wow

On Fri, Feb 5, 2021, 21:20 Abdeldjalil Hebal notifications@github.com wrote:

Yesterday, I tested this project on Linux (Ubuntu 18.04 x64) and found it to be useful. I personally didn't need to play audio from my phone, but to use it as a microphone, so I ended up using @bitplane https://github.com/bitplane's Microphone https://github.com/bitplane/Microphone and running your program (usbaudio --no-play --device 04e8:6860).

I wanted to share it with my Windows-using student peers, and thought of the following:

This program depends on libusb (which is cross-platform) and libpulse (Linux-only, AFAIK), while others are either cross-platform or have been ported (e.g. getopt.h as in this Stack Overflow answer https://stackoverflow.com/a/35259706).

1.

When building for/on Windows, you could (conditionally) remove PulseAudio's stuff (i.e. pulse.h, pulse.c, and its dependency entry from meson.build) and replace int pulse_get_device_number(const char *serial)) with a no-op function that simply returns -1 (the error code). 2.

Windows users should just run usbaudio with the --no-play option. (We just need it to enable audio forwarding.) 3.

Finally, Windows users should feed audio from the new "USB audio input device" (the Android phone in accessory mode) to their speakers or headsets. (It is possible to do this natively since at least Windows 7 as mentioned in Super User https://superuser.com/a/418725, and the same method works on Windows 10 as shown in this video https://www.youtube.com/watch?v=8KdjSqW1s6U.)

PS: Perhaps the third step can be automated.

What do you think, @rom1v https://github.com/rom1v ?

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rom1v/usbaudio/issues/28#issuecomment-774116207, or unsubscribe https://github.com/notifications/unsubscribe-auth/AOUJCTYB5KF4HTYAPLPH63LS5QHVVANCNFSM4V4TFIKQ .