iOS Ambient Audio Extension

yoplalala

  • *
  • Posts: 1632
OpenFL iOS Audio Extension

This is the original extension https://github.com/grapefrukt/extension-ios-audio

I have just adapted  it to Stencyl.



Enables setting the iOS audio session as "ambient" to allow playback of external audio while playing a game. It also exposes a way to know if external music is playing or not.

# Stencyl specific usage

Enable the extension and then the app will enable to allow playback of external audio at the start of the Game.

Stencyl Blocks





You can enable or disable ambient music.


You can check if external music is playing ?



On Gitlab https://gitlab.com/haxe-stencyl/stencyl-extension_os_audio_ambient

PS: I haven't tested this extension for a long time

« Last Edit: April 01, 2021, 01:21:27 pm by yoplalala »

soereide

  • *
  • Posts: 31
Thanks!
Just what I needed. Seems to work fine.
Also fixes audio going silent on interruptions, like using Siri, if you add extension.iosaudio.IOSAudio.fixInterrupt(); to a code-block.

yoplalala

  • *
  • Posts: 1632
Thanks Soereide ! Do you think there are some people who woudn't fix the silen audio on interrupts  ?
It it's the case I'll make a block. If it's not the case I'll make it to call it  automatically at the start of the app  without needing the blocks.

soereide

  • *
  • Posts: 31
Well I haven't had any issues so far, but something might come up.
Probably good to have the option of turning it off.