0
0

Hi
i use fmod on my windows mobile 6 device,
i donn’t know how to control the volume,and
i donn’t know how to play the music through the
earphone either,
can anyone help me?

here is my code:

void PlaySong(CString &sSongPath,int iVolume)
{
FMUSIC_MODULE *mod = NULL;

TCHAR *fname = sSongPath.GetBuffer((sSongPath.GetLength() + 1) * 2);

char  s[256];

WideCharToMultiByte(CP_ACP, 0, fname, -1, s, 256, NULL, NULL);

FSOUND_SetVolume(FSOUND_ALL,iVolume);

FSOUND_STREAM *stream = NULL;
mod = FMUSIC_LoadSong(s);
if (!mod)
{
    stream = FSOUND_Stream_Open(s, FSOUND_NORMAL | FSOUND_LOOP_NORMAL | FSOUND_2D | FSOUND_MPEGACCURATE, 0, 0);
}

if (!mod && !stream)
{
    return;
}

if (mod)
{
    if (FMUSIC_GetType(mod) != FMUSIC_TYPE_IT)      /* IT has its own master volume setting */
    {
        FMUSIC_SetMasterVolume(mod, iVolume);
    }
    if (FMUSIC_GetType(mod) == FMUSIC_TYPE_MOD || FMUSIC_GetType(mod) == FMUSIC_TYPE_S3M)
    {
        FMUSIC_SetPanSeperation(mod, 0.85f);    /* 15% crossover */
    }
}

FMUSIC_PlaySong(mod);
FSOUND_Stream_Play(FSOUND_FREE, stream);

}

  • You must to post comments
0
0

get the channel value from FSOUND_Stream_Play and pass it to FSOUND_SetVolume.

  • You must to post comments
0
0

hi brett
Thanks very much,
Now it works

Another question: 😛
How can i select the eraphone instead of speaker?

thanks again

  • You must to post comments
0
0

Try FSOUND_SetDriver, (also getdrivername etc) and see if it is listed as another output.

  • You must to post comments
0
0

Thanks very much,i’ll try:)

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.