Hey,
for demontration purpose, I wrote an little App (thanks to newlc.com for the sound1 example) for playing 3 files (ogg, mp3, wav).
Followring codes works as espected
Code:void CSoundAppUi::HandleCommandL(TInt aCommand) { switch ( aCommand ) { case EAknSoftkeyBack: case EEikCmdExit: { Exit(); break; } case ESound1CmdAppOpenOgg: { if (iSoundPlayer) { iSoundPlayer->Stop(); delete iSoundPlayer; } iSoundPlayer=CSoundPlayer::NewL(_L("E:\\System\\Apps\\Sound1\\live_session.ogg")); break; } case ESound1CmdAppOpenMp3: { if (iSoundPlayer) { iSoundPlayer->Stop(); delete iSoundPlayer; } iSoundPlayer=CSoundPlayer::NewL(_L("E:\\System\\Apps\\Sound1\\BornBad.mp3")); break; } case ESound1CmdAppOpenWav: { if (iSoundPlayer) { iSoundPlayer->Stop(); delete iSoundPlayer; } iSoundPlayer=CSoundPlayer::NewL(_L("E:\\System\\Apps\\Sound1\\Play.wav")); break; } case ESound1CmdAppPlay: { if (iSoundPlayer) iSoundPlayer->Play(); break; } case ESound1CmdAppStop: { if (iSoundPlayer) iSoundPlayer->Stop(); break; } default: break; } }
But I want the app to play the selected file immediatly by using this code
nothing happens. The files wont be played. Why?Code:void CSoundAppUi::HandleCommandL(TInt aCommand) { switch ( aCommand ) { case EAknSoftkeyBack: case EEikCmdExit: { Exit(); break; } case ESound1CmdAppOpenOgg: { if (iSoundPlayer) { iSoundPlayer->Stop(); delete iSoundPlayer; } iSoundPlayer=CSoundPlayer::NewL(_L("E:\\System\\Apps\\Sound1\\live_session.ogg")); iSoundPlayer->Play(); break; } case ESound1CmdAppOpenMp3: { if (iSoundPlayer) { iSoundPlayer->Stop(); delete iSoundPlayer; } iSoundPlayer=CSoundPlayer::NewL(_L("E:\\System\\Apps\\Sound1\\BornBad.mp3")); iSoundPlayer->Play(); break; } case ESound1CmdAppOpenWav: { if (iSoundPlayer) { iSoundPlayer->Stop(); delete iSoundPlayer; } iSoundPlayer=CSoundPlayer::NewL(_L("E:\\System\\Apps\\Sound1\\Play.wav")); iSoundPlayer->Play(); break; } case ESound1CmdAppStop: { if (iSoundPlayer) iSoundPlayer->Stop(); break; } default: break; } }
I'm an absolute beginner - please be patient with me!
Manuel



