MediaLauncher on emulator(virtual device) - android

Is it possible to play and record speech on android emulator? or it must require physical device?

Sorry, but its require a physical device... At least to recording:
Note that the emulator doesn't have hardware to capture audio or video, but actual mobile devices are likely to provide these capabilities
http://developer.android.com/guide/topics/media/index.html

Related

Unable to record from USB microphone on Chrome on Android (Lollipop)

Based on previous thread, getUserMedia is supported in Chrome on Android now (version 40).
I got this working using the usual getUserMedia idiom (see, for example, http://www.html5rocks.com/en/tutorials/getusermedia/intro/).
This works on desktop (any mic) and on mobile (default mic).
However, when a USB mic is plugged in, this does not seem to work. The usual permission dialog is shown. However, the input audio will actually come from the phone's default mic (ie, scratching/tapping the usb mic produced no noise), even though the USBmic is clearly connected (ie, it lit up).
On desktop, you can fix this by selecting the audio input source, but I'm not sure how to do that on Android.
The really funny thing is that typical audio recording APPs can actually CORRECTLY get the audio input from the USB mic on the same device.
Has anyone experienced this problem?
I can reproduce this issue it appears to be specific to some Android phones and Android tablet devices that I have tested, including a Samsung Tab A7 and the Amazon Fire 10".
Currently testing Samsung Tab A7 with Chrome 103.0.5060.129 Android 11; SM-T220 Build/RP1A.200720.012
I do not have this issue in chrome on my Android Oneplus 8 running Android 11.
More information for reproducing:
The expected behavior does not work in Chrome, but does work as expected in Firefox.
Plug in an external USB microphone device
Open a site such as https://vdo.ninja/ or a https://www.webrtc-experiment.com/
Capture audio.
The default audio will be captured from the devices internal microphone instead of the USB microphone.
On sites such as the vdo.ninja, where you are able to select the audio source, even if the source is listed, such as "Wired Headset", changing the input will result in using the internal microphone.

Android Capture USB Mic Audio without root

My Android application is targeting non-rooted Samsung Galaxy Note 2 phones running Android 4.4.2.
When my USB microphone is plugged into the phone, it appears as /dev/snd/pcmC1D0c, so I know it is being recognizing as an audio capture device.
Is there a way to capture the Audio from this device into my app without rooting the Galaxy Note 2?
I tried AudioRecord with all the MediaRecorder.AudioSource options and they all use the phone's internal mic.
I did not find any option in Settings/Sound to change the input device.
I investigated Samsung's Professional Audio SDK and it looked very promising until I found the Galaxy Note 2 device I am targeting is unsupported by this SDK.
If there is no way to access it from Java, is it possible to use native c code (JNI) to access the existing tinyALSA driver and capture the audio without rooting the phone?
I know I can use use libusb to capture the audio packets directly, but I was hoping for an cleaner/easier way since the phone already recognizes my audio input device.

Testing Voice Recognition App ~ Audio Out to Mic In Adapter

I'm developing an Android voice recognition app for my master thesis.
The app comes with different algorithms that transcribe voice.
To test which of them works best I want to feed the devices microphone with the same speech sample over and over again. I decided to use an open audio book from http://www.librivox.org.
I need an adapter to feed the audio book into my devices microphone input port since the Android VD (Emulator) does not support microphone input.
I have tested a direct connection:
AUDIO OUT (LAPTOP) ─────┐
├─[SPLITTER]─────HEADSET PORT (Device)
─────┘
* Splitter
This does sometimes work on my Sony Xperia ZL even though the quality is really bad.
I also tried an iRig instead of the splitter - but I think the input for the iRig is only for guitars' line out.
So: Is there a way to feed some audio output to my Android devices microphone input?
Although I didn't manage to feed my real device's mic with audio from my laptop I found a solution.
THE DIGITAL WAY
Step 1: To test my app I now use an Android-x86 in a VirtualBox on Ubuntu.
The Android-x86 is a Cyanogen modded Android 4.4 running on (virtual) machines and has microphone support (contrary to the original Android AVD). I tried this on Windows 8.1 but the mic stayed silent.
Step 2: I have to map my main audio output channel to a virtual audio input (virtual microphone). I mostly followed the instructions of this answer using PulseAudio, PulseAudio Volume Control and the magic command: sudo modprobe snd_aloop
Step 3: Set "Monitor of Built-In Analog Stereo" in PulseAudio Volume Control to standard device. Then set the Host Audio Driver to ALSA and run the machine.
THE ANALOG WAY
However I'm not giving up on the cable thing and will update this answer onSuccess().

Recording the Android screen

I want to write an game for Android. To present it very well, it has to have an YouTube movie in the Google Play Store.
How can I do this? Because ADB only produce a slideshow, because it's to slow. Is there an app for recording out there?
PS: I only have Tegra devices (Galaxy Nexus and Nexus 7), so http://pkg.to/com.ms.screencast doesn't work, yet.
The new Android 4.2 has a wireless display feature allowing the send the screen's content to TV screens etc. As you have Nexus devices I guess you'll get the update very soon. I do not know the technical details but I'm quite sure there will be possibilities to record the sent signal.
See this anouncement: http://www.android.com/whatsnew/
You may want to try using the emulator and record using a regular video recording program such as FRAPS. The performance of the x86 emulator has improved greatly and also supports GPU emulation.
Here is a page from the Android documentation outlining how to enable hardware acceleration for the emulator:
http://developer.android.com/tools/devices/emulator.html#acceleration
The downside to this approach is that multi-touch gestures aren't easy to do.

How to Stream Audio from PC through Bluetooth

Here's what I am trying to do. Capture any audio being currently played on the PC and stream it through Bluetooth and then play it through the Android device paired with the PC. I have worked with Bluetooth a little but very basic stuffs. And I have very less idea on how to go about on this. My target device is Android 2.2 (and above). I guess I have to use Bluetooth profiles, but not too sure. Also, I am not aware of any other caveats that I may have to face.
Would anyone like to point me at the correct direction. Any tips, links would help. Thank You.
It depends on the capability / profile that your android device supports, for streaming you normally will use the A2DP profile and the android device will need to support the A2DP sink role. Typically this role is supported by Stereo headsets , speakers etc. Android phones do not support sink - phones are A2DP source (or initiator of the streaming)

Categories

Resources