Audiotoggle cordova plugin not working in android 9 - android

I have Cordova app and I have android platform 8. App uses JQuery Verto library for getting remote audio stream and play it in audio html element.
By default Verto find one speaker device with id = 'default'. Next after playing audio I need use EARPIECE device.
In android 8 I use audiotoggle-plugin for it(use AudioToggle.setAudioMode(AudioToggle.EARPIECE) method) and it worked normal. But on Android 9, it doesn't work.
However, When remote stream is playing through the default speaker, if I start another app (example YouTube and play video) and then stop it and get back to my app, audiotoggle-plugin work normal.
Any ideas?
Here is the plugin's link: https://www.npmjs.com/package/cordova-plugin-audiotoggle

Related

Xamarin Forms allow music from another app on Android while playing Video

I am facing the issue, that my App Blocks Background Music when using a MediaElement for Video usage.
The bottom line is that I want to play a silent video and the user should still be able to listen to spotify and etc. in the background
In iOS the procedure to allow Background Music is pretty straight forward. On Android I cannot manage to get it working.
I already tried different xamarin.forms libraries where i set the video to mute or the volume to zero.
But nothing seemed to work. I tried for example octane, mediamanager and several other videoplayers.
For this reason, I would now like to try to implement it in the native Android code.
But I haven't found anything about it in various forums.
Xamarin Forms Version is 4.8
You could use a service to stream audio to play audio while your application is not visible or under the lock screen.
You could check the blog about this and download the source file from the Github. https://devblogs.microsoft.com/xamarin/background-audio-streaming-with-xamarin-android/
I test with the sample in the thread i done before to play the audio. libVLCsharp.forms can not play Android resource video file while iOS can
When i make the app which play music in the background, the music would play as well.

Android webview microphone capture issue

I am trying to record audio using an app that runs WebView. For example, I load the app in the URL https://online-voice-recorder.com/ and records some audio over the mic. I have given enough permissions and able to record and replay the audio. On Windows 10, it works perfectly. But on my Android Oreo 8.1.0 running Chrom version 80, this audio is fully distorted. I tested it another device and the audio is partially legible.
Is this a standard behavior?
What I have tried to see what is the problem: I wrote a backend netcore3.1 app to play the audio and it plays the same distorted sound.
I have also tried using default sampling rates and custom and in either case, the audio remains distorted.

How do I get sound from my html5 web app to play in an android webframe?

I'm trying to get my web-app (hiit-fit-training.com) to run inside of an android web view. It works fines visually but has some issues with the sound. . Inside the web app I use a third party TTS service (responsiveVoice) and a simple beep:
var audio = new Audio( '../assets/_sound/beep.mp3' );
audio.play();
The beep has never played in the web-app and the TTS voice worked occasionally in the baconreader android app web-view. They both work perfectly inside of android Chrome. Neither sound sources work in my web-view though..
Although most likely different, pointing the web-view at youtube, I discovered it can play youtubes audio.
Are there any workarounds or suggestions on how to implement my sound effects?
Figured it out by looking through the console and discovered a security setting:
Failed to execute 'play' on 'HTMLMediaElement': API can only be initiated by a user gesture.
It can be solved by using the following setting:
myWebView.getSettings().setMediaPlaybackRequiresUserGesture(false);

ExoPlayer Video not playing for Android version 4.2.1

I have one issue while using android ExoPlayer for streaming url.
Here I have attached sample URL:
http://epicmediaservice.streaming.mediaservices.windows.net/0bd4f655-00f9-4e36-a638-f8e90d9432c9/Nursery%20Rhymes%20Sample%20Clip.ism
It is working in some device, but not not working for Android version 4.2.1 (Micromax canvas 116)
It shows buffering video, but not playing.
If I select video option as OFF then it plays, but only audio comes no pictures visible.
new Sample("Super speed (PlayReady)",
"http://epicmediaservice.streaming.mediaservices.windows.net/0bd4f655-00f9-4e36-a638-f8e90d9432c9/Nursery%20Rhymes%20Sample%20Clip.ism",
DemoUtil.TYPE_SS),
Looks like you are trying to play DRM-protected content (PlayReady) which probably won't work since Exoplayer doesn't support DRM until Android 4.3 and upwards, also check on your device's documentation that it really supports PlayReady.
Check section Digital Rights Management on ExoPlayer's developer guide.

HTML5 audio recording not woorking in Google Nexus

I want to use HTML5 getusermedia to record audio, play back and save to server. I am trying with Google Nexus (Android 4+) and Google Chrome 29. Is it possible? When I try the codes I got from net, it asks permission to record using microphone and using the phone, I save a wav file. But no sound on playing this. The same site works from chromium browser in my PC. Am I doing anything wrong? or is it that audio recording is not actually working as it claims?
Thanks
We now have Web Audio input working in Chrome for Android Beta (31.0.1650.11).

Categories

Resources