teamclouday / AndroidMic

Use your Android phone as a mic to Windows PC
MIT License
113 stars 9 forks source link

Choppiness & huge audio delay over USB tethering #2

Closed LoganDark closed 2 years ago

LoganDark commented 2 years ago

Here's what my voice sounds like over Discord using AndroidMic:

https://cdn.discordapp.com/attachments/252112570423443456/960636721073098822/Record_2022-04-04_at_13h26m54s.wav

there's also an audio delay of around 2 seconds.

AndroidMic.exe process priority is set to real-time

teamclouday commented 2 years ago

Thanks for trying the app! Had similar experience about the sound quality and dely. I'm not actively working on this project, but will definitely take a look into it later.

teamclouday commented 2 years ago

Hey, I've released 1.6.0 . Choppiness has been solved. Audio delay is a more complex problem. I've improved the performance of code. Hopefully it is an acceptable delay now.

Just for future reference:
Choppy audio is caused by a wrong setup of NAudio WaveOut player on Windows side.

// this causes issue
playerDesiredLatency =  50;
playerNumberOfBuffers = 2;

// this is fine
playerDesiredLatency = 100;
playerNumberOfBuffers = 3; // can also be 2

// init
player = new WaveOut
{
       DeviceNumber = -1,
       DesiredLatency = playerDesiredLatency,
       NumberOfBuffers = playerNumberOfBuffers
};
LoganDark commented 2 years ago

@teamclouday I decided to just bite the bullet and get a $10 microphone from Amazon. My laptop's audio system is fried but I was able to get around it by using a USB-C-to-3.5mm adapter. So, no need for this solution anymore :)

But glad to hear that you were able to solve the issue! Closing.