0
0

Hello,
I have a fully working mp3 player for Windows Mobile6 (Windows CE 5.x)
I noticed that when the CE device sleeps I must close FMOD using FSOUND_Close(); and then call FSOUND_Init() again. If I don’t no sound comes out. I know I can set the power mode not to sleep but this seems like a bandaid.

Has anyone else noticed this???

Thanks
Paul 😮

  • You must to post comments
0
0

I have too. I had to add a "Debug" section to the menu of my mp3 player to allow the user to "Initialize Audio" which does what you said. I don’t make the call to FSOUND_Close() though, I just invoke FSOUND_Init again.

  • You must to post comments
0
0

Hi,
I added this to my project

[code:2un8jnkg]
[DllImport("coredll.dll", SetLastError = true)]
static extern int SetSystemPowerState(string psState, int StateFlags, int Options);
const int POWER_FORCE = 0x1000;
const int POWER_STATE_ON = 0x10000;
[/code:2un8jnkg]

Then in the playback loop
[code:2un8jnkg]

                SetSystemPowerState(null, POWER_STATE_ON, 0);

[/code:2un8jnkg]

I also added this to my open

[code:2un8jnkg]
if (FMOD.FSOUND_HasPowerOnOccurred())
{
FMOD.FSOUND_Close();
bool init_ok = FMOD.FSOUND_Init(22050, 16, FMOD.FSOUND_INIT_GLOBALFOCUS);
}

[/code:2un8jnkg]

The reason for the close is to try to prevent a possible memory leak

  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.