How to turn a smartphone into a microphone (ideas and questions)
Hello. I would like to talk about how you can turn a smartphone into a microphone for a computer. I have a few ideas, some of which I have already tried to apply.
Why do you need it?
It so happens that you need to make voice acting for some video, but there is no high-quality microphone on hand. To sound on the internal microphone is to ditch the video. But the recording quality on many modern smartphones is very decent. Therefore, you have to write to your smartphone, and then transfer the recording to a computer.
But there is little comfort here. If you do dubbing, then you constantly have to re-record fragments where you need your speech to be faster or slower. And this means that every bad time you need to copy the recording file from your smartphone to the PC again. I want to avoid this, that is, to make the recording immediately appear on my computer, as if you connected a real microphone. ')
Below I will list my ideas, bring their pros and cons. I would like to hear your comments about the possibility of their implementation.
Idea 1. Smartphone as a bluetooth headset
1. Write a driver for Android smartphone, which would be presented to its surrounding devices as a wireless headset (with microphone). 2. Write an application for Android smartphone, which will take the sound from the built-in microphone and send it to this driver. 3. Search for bluetooth devices on the computer, connect the “wireless headset”. 4. Select it on your computer as a priority microphone. 5. Profit
pros
No manipulation on the computer. Does not require additional AO for the user.
Minuses
Most likely you will need root on your smartphone
My comments and questions
1. Is it possible to create such a driver? It seems to me that yes. I saw something similar to connect the DualShock 3 (bluetooth gamepad for the PlayStation) to a smartphone (Sixaxis Controller). 2. Will there be a delay in transmission? I am sure that yes. 3. Will the transfer take place without loss? I do not know.
Idea 2. The audio output of the smartphone on the computer's audio input
1. Create an adapter from TRS to TRRS (CTIA) 2. Create an attenuator line to mic (how to do it - we will discuss in my next video) 3. Launch the Mic To Speaker application, which outputs sound from the smartphone’s built-in microphone to the speaker / audio output of the smartphone. 4. Connect the smartphone to the computer via an adapter with an attenuator. 5. Select the external microphone on the computer as a priority. 5. Profit
pros
No manipulation on the computer.
Minuses
Requires additional hardware
My comments and questions
1. Is it possible to output certain sounds (notifications) to the built-in speaker if a plug is inserted into the audio jack?
2. Is it possible to record sound from the internal microphone, if suddenly the smartphone determines that an external microphone is available? I think that the application itself can choose from which device to take sound (from a built-in or from an external microphone). But in order to avoid unnecessary problems, it is better to insert the TRS plug into the smartphone, and not the TRRS.
Idea 3. Smartphone as an audio card
1. Make a program (or what?) So that the smartphone can be identified to the USB host as an audio card (i.e. tell the computer Pid: Vid corresponding to any audio card). 2. Write an application on Android, which will send sound from the built-in microphone to the "sound card". 3. Activate the vid: pid substitution and run the application 4. Connect your smartphone to your computer by usb 5. Select on the computer a microphone from an external audio card as a priority 6. Profit
Note: the above is not related to USB Audio for android. USB audio allows you to connect an external zvukovuhu to a smartphone. That is, the sound from the smartphone can be output to it and input from it to the smartphone. But we need the smartphone itself to be an audio card.
pros
No manipulation on the computer.
Minuses
Most likely you will need root on your smartphone Additional delays on usb controllers
My comments and questions
1. Is it possible to substitute Vid: Pid or can it be done only by hardware? 2. Is it possible to use usb_ModeSwitch to control such a substitution from a computer, or such manipulations can only be done on a smartphone? 3. Is the usb 2.0 bandwidth sufficient to transmit sound normally? It says here that the maximum theoretical rate for high-speed usb is 1,023,000 bytes / sec.
Idea 4. To stream audio over the network.
1. Install an application that sends an audio stream from the internal microphone over the network (I used Ip Webcam, but this is not free). 2. Forward the network of the smartphone on the computer via adb via usb (to exclude wifi). Ip Webcam-gst can do this automatically. 3. Get access to this stream from a computer. 4. Register a virtual microphone in the system. Wrap the received http stream into it as a source. [Need for versatility. Although you can use a record player that can immediately catch such streams, for example, vlc or open broadcaster]. 5. Select this virtual microphone as a priority on the computer 6. Profit
pros
Do not need root on your smartphone
Minuses
Computer client software required
My comments and questions
1. VLC has built-in ability to capture http stream, but it has serious inconvenience when recording (at least in Gui). How vlc can capture a stream using the command line is not figured out. Can someone tell me?
2. Ip Webcam-gst can register a virtual microphone, but cannot use a codec other than Wav. Who understands gstreamer pipelines ? We need to build a pipeline that would support Opus and aac.
3. I saw the application WoMic, which implements such functionality. It requires Win or Mac. And on Linux I used ipwebcam. This is a non-free program. I think it would be better to include ipwebcam functionality (by audio part) in KDE Connect . I would be glad if someone helped me with this.
Idea 5. Computer as bluetooth headphones for a smartphone
1. Write a driver (?) For a computer that would present it to surrounding devices as bluetooth audio speakers. 2. Write a program for the computer that will register the virtual microphone and direct the sound coming to the “speakers” into it. 3. Run the program on the computer and remain visible bluetooth device. 4. Launch the Mic To Speaker app on your smartphone and connect it to the “wireless headphones”. (I didn’t check if it is possible to change the drain when this application is working, but I think there shouldn’t be any problems. If there are problems, then you need to write a program for android that will direct the sound from the built-in microphone to the bluetooth speakers). 5. Select a virtual microphone on the computer as a priority. 6. Profit
pros
Do not need root on your smartphone
Minuses
For the simultaneous normal functioning of the Bluetooth company (for example, for a bluetooth keyboard), you will most likely need an additional bt dongle. I saw a similar situation with the dualshock driver for the computer.
My comments and questions
Which of all the proposed options will provide the least delay in transmission?