Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial HTML5 Audio() volume low when plugin is installed, normal when not installed #654

Closed
bkervaski opened this issue Mar 9, 2021 · 3 comments

Comments

@bkervaski
Copy link

bkervaski commented Mar 9, 2021

  • [ x ] I have used Google with the error message or bug in association with the library and Cordova words to make sure the issue I'm reporting is only related to iOSRTC.
  • [ x ] I have provided steps to reproduce (e.g. using sample app code https://github.com/cordova-rtc/cordova-plugin-iosrtc-sample or updated extra/renderer-and-libwebrtc-tests.js file).
  • [ x ] I have provided versions of third party library name, ios, Xcode and plugin version and adapter.js version if used.

Note: If the checkboxes above are not checked (which you do after the issue is posted), the issue will be closed, removing this checkbox will result in automatic closed issue.

Versions affected

  • Cordova version (e.g 7.1.0): 10.0
  • Cordova iOS version (e.g 5.1.0): 6.2
  • Plugin version (e.g 6.0.12): 6.0.19
  • iOS version (e.g 10.2): 14.4.1
  • Xcode version (e.g 11.1 - 11A1027): 12.4
  • WebRTC-adapter version (e.g. 7.4.0): None
  • WebRTC Framework version (e.g. JSSip 3.1.2): JSSip 3.7.1

Description

When ios-rtc plug is installed, initially all HTML5 Audio() plays at extremely low volume until the first time ios-rtc makes a call, and then HTML5 Audio() is normal level afterwards and stays that way until the app is restarted.

With ios-rtc not installed, HTML5 Audio() plays at normal volumes as expected.

Note this is easily reproduced with other combinations of software other than above.

I tried selectAudioOutput and turnOnSpeaker as well as initAudioDevices with same results.

Steps to reproduce

let test = new Audio('somefile.mp3')
test.play()

Expected results

Audio plays at normal volume as without ios-rtc installed.

Actual results

Audio plays at low volume, barely perceivable.

@hthetiot hthetiot added this to the 6.0.x milestone Mar 9, 2021
@hthetiot
Copy link
Contributor

hthetiot commented Mar 9, 2021

@bkervaski
Can you try to set MANUAL_INIT_AUDIO_DEVICE options to false in plugin.xml or/and package.json and see if you still have the issue.

<plugin name="cordova-plugin-iosrtc">
        <variable name="MANUAL_INIT_AUDIO_DEVICE" value="TRUE" />
</plugin

@bkervaski
Copy link
Author

bkervaski commented Mar 9, 2021

Boom! That got it :)

Also adding:

let hack = new Audio('silence.mp3')
    hack.play()

Prevents any HTML5 Audio() startup lag, where silence.mp3 is a valid mp3 with no audio ... testing but seems to work like a charm! Now I can finally give up the native audio plugin.

Big thanks :)

@hthetiot hthetiot modified the milestones: 6.0.x, 8.0.x Mar 17, 2021
@hthetiot
Copy link
Contributor

We surely need a better solution in the future, but closing the issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants