Saturday, December 11, 2021

IdeaPost: convert usb keyboard mouse to bluetooth

Note:
This is an IDEA post not a standalone working solution.


I was planning to create an Android app which converts usb keyboard and mouse to bluetooth. This is an idea that can easily be created but there are various problems which make it inconsistent also. The idea is to plug usb keyboard and mouse into Android device using otg and then using a software to establish bluetooth connection with pc or other device. The software are already available on Playstore which can do something like this e.g. https://play.google.com/store/apps/details?id=io.appground.blek

There are many other apps also. However these apps do not route keyboard and mouse events from usb. They make screen itself as a mouse and utilize input text field for keyboard events.

The solution is to make app which listens to hardware events and transfers them to PC etc. Android can use various services to intercept keyboard and mouse events. If anyone is interested i can make it but i don't think it (again) will help me financially like previous apps gone through. If you are a developer then do share me your app if you make one.

If you are a normal user who has found a working solution do share it in comments section i will update the blogpost. The solution of complex methods already exists!. Like using rooting of device, accessibility service for inputs etc. These apps are surely going to stop working in coming android updates :0.

Privacy/Security threat:
Any app which can listen to keyboard can also log all events and cause a privacy security threat. For  example if you are visiting a bank website and its obviously sure whatever your type after opening this website is your password, username etc. This is what loggers do. They save whatever you type. Due to this listening to input events is not allowed by any operating system. I hope this article gives some ideas and some possible problems while implementating the ideas.

Wednesday, December 1, 2021

Cheapest, simplest method to record Binaural sounds using 2 recorders, phones etc.

 


Binaural sounds are almost like what we hear with natural source. If someone says hi behind us and we record audio in mono, stereo and binaural the best output with realism is recorded in binaural. This article makes a basic quality binaural recorder. The quality is not great because of limitations and manual steps required causing further inaccuracies. You can check the sample quality at end of article to check what it feels like.


As picture above shows we need 2 audio recorders. I used 2 Samsung devices with same official recorder app. Phone acts as left ear and tab acts as right ear. MIC are at top of the devices and therefore top is kept at middle of a box. Box acts are head reducing audio from both sides. Recording on both devices should begin at the same time!. If recording time is not same on both we have to shift the playback timing of one track to match both tracks.


IMPORTANT:

2 recorders must be of same hardware/model, same software and same settings to get same audio data. Different devices can work but many times volume levels & dominating frequency can differ e.g. high frequency/volume on left, lower on right etc.


When recording is done below steps are to be done to create final sound.

- Start Audacity app.

- Import Left audio recording from whatever device acted as left. If imported file is stereo it has to be converted into mono. Audacity can do that easily. Now this mono track should be set to Left Only track. There is a slider to set panning between Left and Right. Slide it to leftmost.

- Same as above right track is imported. Slider is shifted rightmost.

- Now Check the waveforms and using this the shifting of track can be done to match the timing issues happened during starting of recorders. Suppose started recording with a clap. Using the clap as reference we can do shifting of Left or right track until the timing error caused during recording is diminished.

- NOTE: Lets assume both track have been set to perfect time match i.e. a sound is heard at both ears at same time. This is actual wrong setup for binaural!. When sound comes from right it reaches right ear first and then left. The time travelled between right left ear MUST EXIST between the tracks. This is important for accuracy of audio source positions. Below is technical information and can be avoided if you cannot understand the topic but it tells the importance of time difference between Left and Right.

https://en.wikipedia.org/wiki/Interaural_time_difference

https://en.wikipedia.org/wiki/Sound_localization


After shifting of tracks sound can be tested and it will surely sound like binaural. The above method is very cheap and prone to lots of errors. This article is for giving understanding of binaural and some experimentations for advance work. Below is the recording I created.


Sample recording file:


https://drive.google.com/file/d/140yaOUVX4ptCyBduURUFXzGjx3Nrwl7o/view?usp=sharing


I hope this article has helped you in binaural recording. I also made an Android app in 2016 with automated process and create binaural recording easily. However I could not keep developing the app. Below are some links to the app -


https://forum.xda-developers.com/t/binaural-3d-sound-recorder-app-using-2-devices-as-mic.3361953/


backup apks for old android devices only. -


https://drive.google.com/file/d/1PP1N1HsOfLVqaMEMj77g0giLON9ecNuV/view?usp=sharing

Sample i recorded using my android app

https://drive.google.com/file/d/1PftsM9XHOUJB8vzL4cB4vUV5mGZ-28v3/view?usp=sharing