Вопрос

I have created a project that utilizes original libFLAC.dll code to play FLAC files on Windows Phone 8.0. It used to work both in MediaElement and in background on WP 8.0, but after updating the project to Windows Phone 8.1, the sound became flickering and the components began "stack overflow"-ing.

I have updated the project to Windows Phone 8.1 Runtime project since Silverlight 8.1 doesn't support Background Audio. Though the problems were when using both Background Audio and MediaElement in Windows Phone Runtime app.

As it seems unclear, I want to clarify: I have created a MediaStreamSource adapter that hooks Windows.Media.Core.MediaStreamSource events and does all the work. I don't use Silverlight's MediaStreamSource implementation of course.

I have created a thread on MSDN forums where one can find more details, and open-sourced the project on CodePlex so everyone can just take the source code for both WP 8.0 and WP 8.1 and see what's gone wrong.

I really hope someone could find workaround or at least make Microsoft aknowledge the problem.

Это было полезно?

Решение

Okay, so thanks to MSDN forums community an @mcosmin especially, the solution was found and it is pretty simple.

To fix this, I simply need to set the Duration property of the MediaStreamSample, because unlike Silverlight's sample, WinRT's sample cannot calculate it on its own.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top