0
0

Hi all,

In the Windows Metro implementation, FMOD don’t set the BackgroundCapableMedia flag so I haven’t be able to play audio in background.
Is something in the works about that ? Maybe a new flag could be added to FMOD_INITFLAGS or FMOD_MODE enum :)

Thanks,
Charles

  • You must to post comments
0
0

Hi Charles,

This will be available in the 4.43.08 release of FMOD Ex by filling out a FMOD_WINDOWSSTOREAPP_EXTRADRIVERDATA object and passing it as the extradriverdata parameter of System::Init().

Nicholas Wilcox | Programmer
FMOD by Firelight Technologies Pty Ltd
Interactive Audio Middleware | http://52.88.2.202
PH: +61 3 96635947 Fax: +61 3 96635951

  • You must to post comments
0
0

Hello,

Setting the play_in_background to 1 seems to have no effect actually :(.
Even if my app is marked as background audio task capable and I handle events of the MediaControl class.

Have you got a working example of the feature ?

Thanks,
Simon

  • You must to post comments
0
0

The playsound example can be quickly modified to support background audio.

Adding to main.cpp at line 27
[code:2l8b0nuw]
using namespace Platform;
using namespace Windows::Foundation;
ref class DummyHandler sealed
{
public:
DummyHandler()
{
Windows::Media::MediaControl::PlayPressed += ref new EventHandler<Object^>(this, &DummyHandler::DummyMediaControlHandler);
Windows::Media::MediaControl::PausePressed += ref new EventHandler<Object^>(this, &DummyHandler::DummyMediaControlHandler);
Windows::Media::MediaControl::StopPressed += ref new EventHandler<Object^>(this, &DummyHandler::DummyMediaControlHandler);
Windows::Media::MediaControl::PlayPauseTogglePressed += ref new EventHandler<Object^>(this, &DummyHandler::DummyMediaControlHandler);
}
void DummyMediaControlHandler(Object^ sender, Object^ args) {};
};
DummyHandler^ myDummyHandler = ref new DummyHandler();
[/code:2l8b0nuw]

and then inserting before the </Application> tag in package.appxmanifest
[code:2l8b0nuw]
<Extensions>
<Extension Category="windows.backgroundTasks" EntryPoint="FmodExample.app">
<BackgroundTasks>
<Task Type="audio" />
</BackgroundTasks>
</Extension>
</Extensions>
[/code:2l8b0nuw]

  • You must to post comments
0
0

Thanks for the answer.
After investigating, it seems that the problem is that MediaControl events must be handled prior to create FMOD system instance. That is good to know !

  • You must to post comments
0
0

I’ll update the getting started to reflect this information.

FYI the way of setting up background audio will change in the next version:
[code:3s3wb0e8]
FMOD_WINDOWSSTOREAPP_EXTRADRIVERDATA extradriverdata = {};
extradriverdata.stream_type = FMOD_WINDOWSSTOREAPP_STREAMTYPE_BACKGROUND;
[/code:3s3wb0e8]

This will allow programs to choose from the full range of audio stream behaviors: background, foreground only, communications, etc.

  • You must to post comments
Showing 5 results
Your Answer

Please first to submit.