logo       

Re: free midi/wavs: msg#00226

java.sun.kvm

Subject: Re: free midi/wavs

Hi adrian,

Well I really don´t know what is happening.

So.. I'll post my code out, so if anyone can tell me what is going on with
it...
The funny thing : it plays ok ( the tones ) in the other series 60 phones :
3650 and Ngage ( without using MMapi )
I've seen some people using .ott on theirs midlet, can this be the solution
for this 7650?

Follows the code:

private void playSound(int priority, byte[] bytes) {
if (!isPaused) {
try {
if (sound == null || sound.getState() !=
Sound.SOUND_PLAYING) {
sound = new Sound(bytes, Sound.FORMAT_TONE);
sound.init(bytes, Sound.FORMAT_TONE);
sound.setGain(128);
sound.play(1); // loop = 1
currentPriority = priority;
} else {
// A sound exists in the SOUND_PLAYING state.
if (priority > currentPriority) {
sound.stop();
sound.init(bytes, Sound.FORMAT_TONE);
sound.play(1); // loop = 1
currentPriority = priority;
}
}
} catch (Exception e) {
currentPriority = 0; // allow any new request to play
}
}
}

//here an example of bytes

private final static byte[] START_HEAVEN =
{
(byte)0x02, (byte)0x4a, (byte)0x3a, (byte)0x40,
(byte)0x04, (byte)0x00, (byte)0x0f, (byte)0x18,
(byte)0x61, (byte)0x04, (byte)0xd0, (byte)0x83,
(byte)0x08, (byte)0x26, (byte)0x83, (byte)0x00,
(byte)0x00
};


public void playStartingLevelHeavens() {
this.playSound(1, START_HEAVEN);
}


Any answer will be great!

thanks in advance!

Regards

Marcelo


----- Original Message -----
From: "Adrian Hill" <ah@xxxxxxxxxx>
To: <KVM-INTEREST@xxxxxxxxxxxx>
Sent: Wednesday, December 17, 2003 6:34 AM
Subject: Re: free midi/wavs


> > Hi Marcelo,
> >
> > As far as I know, Nokia 7650 doesn't support Mobile Media API
> > (MMAPI), which is necessary to play
> > media.
> > Nokia 3650 supports MMAPI, so it can play audio.
>
> Not true.
>
> Series 60 can play audio but cannot vibrate or control backlight, as with
> series 40 phones.
>
> > Does anyone have a workaround for this? I would very pleaseful to hear
> some advice from you guys!
>
> Try searching the http://forum.nokia.com/ site.
>
> This works for me...
>
> public class NokiaGameEffects extends GameEffects implements SoundListener
{
>
> ... // Add all the appropriate overridden methods here
>
> private final static byte[] SOUND_DEFAULT = {
> (byte)0x02, (byte)0x4a, (byte)0x3a // .... and so on
> };
>
> private Sound soundDefault;
>
> public void playDefaultSound() {
> if (soundDefault == null) {
> soundDefault = new Sound(SOUND_DEFAULT, Sound.FORMAT_TONE);
> soundDefault.init(SOUND_DEFAULT, Sound.FORMAT_TONE);
> soundDefault.setSoundListener(this);
> }
> soundDefault.play(1);
> }
> }
>
> HTH,
>
>
> Adrian.
>
> Adrian Hill
> Software Architect
> NRMi
>
> Phone: +44 (0)1482 441142
> Web: http://www.nrmi.co.uk
>
> The information contained in this message is confidential and may be
legally
> privileged. The message is intended solely for the addressee(s). If you
are
> not the intended recipient, you are hereby notified that any use,
> dissemination, or reproduction is strictly prohibited and may be unlawful.
> If you are not the intended recipient, please contact the sender by return
> e-mail and destroy all copies of the original message.
>
>
===========================================================================
> To unsubscribe, send email to listserv@xxxxxxxxxxxx and include in the
body
> of the message "signoff KVM-INTEREST". For general help, send email to
> listserv@xxxxxxxxxxxx and include in the body of the message "help".
>

===========================================================================
To unsubscribe, send email to listserv@xxxxxxxxxxxx and include in the body
of the message "signoff KVM-INTEREST". For general help, send email to
listserv@xxxxxxxxxxxx and include in the body of the message "help".



<Prev in Thread] Current Thread [Next in Thread>
Google Custom Search

News | FAQ | advertise