Hi all,
Please go through the following code segment. Am trying to play a midi file in palm treo 650. Am using codewarrior IDE. There is no compilation errors, but the sound doesnt play in device or the emulator. Is there any problem in the loading of the resource(.midi) . I Coudnt find a way to load the audio data in pilrc designer toolkit , so i loaded it as 'data'.


void Sounds()
{
UInt16 sslRef;
void *buffer = NULL;

              //SndPtr soundP;
              //MemHandle recordH;
              //recordH = DmGetResource(hsSndFormatMidi,2000);
              //soundP = (SndPtr) MemHandleLock(recordH);
              //SndPlayResource(soundP,1024,sndFlagNormal); // 1024 is 0dB
              //err = SysLibFind(HsSoundLib, &sslRef);
{
SysLibLoad(sysFileTLibrary, hsFileSoundLib  , &sslRef);
HsSndOpen  (  sslRef   ) ;
MemHandle recordH;
recordH = DmGetResource('data',2000);
//soundP = (SndPtr) MemHandleLock(recordH);
HsSndFormatPlay(sslRef,hsSndFormatMidi,hsSndCmdPlay,recordH,hsSndCmdFlags_yesWait);
HsSndClose  (  sslRef  ) ;
//MemHandleUnlock(recordH);
DmReleaseResource(recordH);
}

}

--
For information on using the PalmSource Developer Forums, or to unsubscribe, 
please see http://www.palmos.com/dev/support/forums/

Reply via email to