1

I am currently developping a Windows Phone 8.1 app providing Flac background audio playback using a custom media Stream source (written in C++) that converts FLAC frames into PCM samples.

Everything runs fine, except if a Bluetooth handset (or speaker) is connected : the samples I produce seem to never get released by the Background Media Player and I quickly get an "Platform::OutOfMemoryException". (they are correctly released when no Bluetooth audio device is connected)

I tried to set the buffer time of the media Stream source at 0, it only delays the problem (after 30sec of playback, I get the OutOfMemoryException).

I also tried to handle the "Processed" event on my samples, but the event is never raised (either with or without Bluetooth).

Has someone ever seen Something similar ?

Thanks, Simon

Simon Ferquel
  • 366
  • 1
  • 3

1 Answers1

0

Ok, I found the answer. For whatever reason, when you give the a PCM sample to Media Foundation, you must indicates its duration (as well as setting the Keyframe flag to true) for it to work properly with a Bluetooth speaker.

Simon Ferquel
  • 366
  • 1
  • 3