Java-Gaming.org    
Featured games (91)
games approved by the League of Dukes
Games in Showcase (576)
games submitted by our members
Games in WIP (497)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
   Home   Help   Search   Login   Register   
  Show Posts
Pages: [1]
1  Java Game APIs & Engines / J2ME / playing MIDI source code on: 2005-09-19 21:41:20
Could someone provide a complete .java code , which describe how to play a MIDI file using J2ME ?JLB Tongue Tongue
2  Java Game APIs & Engines / J2ME / Re: RMF (sound) and J2ME on: 2005-09-19 20:15:29
The common file formats supported in the phones are midi, wav and amr.

Hi,

Thank you for answer .

I know some phones RMF compatible.
do I  have to change other things than name file and extension and mimetype, in the code ?

Could you provide the same code used for playing a MIDI File ?

Jlb
3  Java Game APIs & Engines / J2ME / RMF (sound) and J2ME on: 2005-09-19 08:48:28


Hi,

I'm a mobile sound producer specialized in mobile sound production.
I would like to play a RMF file on targeted mobiles, using JAVA technology, but I
can't find any example of a *.java file.

I' m using a  "PlayWav.java" source file and I have changed in the code, the "WAV
informations" by the "RMF ones" .  I built the project and packaged the .jar file using the  Wireless Toolkit and all seems ok.

Naturally the file didn't paly in the phone emulator because it's not linked to RMF
on PC. It would play  on targeted phones but I have to test.

Could you tell me if the code below is ok or not:
From the code writen to play a WAV file I have only changed the file
name/extension and mime type and replaced it by the RMF's ones ( at the end of code).



Could you tell me if it's ok in theory or if I have to make more than change the name/exctension and mime type of WAV file by RMF's ones ?

/*--------------------------------------------------
* PlayWav.java
*-------------------------------------------------*/
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.media.*;
import java.io.*;
public class PlayWav extends MIDlet implements CommandListener
{
private Display display; // Reference to display object
private Form fmMain; // Main form
private Command cmExit; // Command to exit the MIDlet
private Command cmPlay; // Command to play wav file
public PlayWav()
{
display = Display.getDisplay(this);
// Create commands
cmExit = new Command("Exit", Command.EXIT, 1);
cmPlay = new Command("Play", Command.SCREEN, 2);
// Create Form, add components, listen for events
fmMain = new Form("Play WAV file");
fmMain.addCommand(cmExit);
fmMain.addCommand(cmPlay);
fmMain.setCommandListener(this);
}
public void startApp()
{
display.setCurrent(fmMain);
}
public void pauseApp()
{ }
public void destroyApp(boolean unconditional)
{ }
/*--------------------------------------------------
* Event handling
*-------------------------------------------------*/
public void commandAction(Command c, Displayable s)
{
if (c == cmExit)
{
destroyApp(false);
notifyDestroyed();
}
else if (c == cmPlay)
playwavfile();
}
/*--------------------------------------------------
* Play a wav file
*-------------------------------------------------*/
public void playwavfile()
{
try
{
// Read wav file, packaged in the jar file
InputStream in = getClass().getResourceAsStream("/sexmachine.rmf");
Player p = Manager.createPlayer(in, "audio/rmf");
p.start();
}
catch (Exception e)
{
// Display an alert
Alert alr = new Alert("Error", "Unable to play WAV file!", null, AlertType.ERROR);
alr.setTimeout(Alert.FOREVER);
display.setCurrent(alr, fmMain);
}
}
}



Thank you very much

Jean Luc Borla Huh
4  Java Game APIs & Engines / J2ME / How can I began with J2ME and sound ? on: 2005-09-19 04:20:04
Hi

I'm a mobile soud producer. I'm working in mlobile sound aera since 4 years.

I can create files  with little sizes ( 30Ko) very big sound quality and long duration more than 1 mn.


I would like to play some of theses files on targeted mobiles, using a "J2ME sound player" .

Could someone provide a complete example of *.java source file ?

I could help in return with audio development

Thank you
 Huh
Jean luc Borla
5  Java Game APIs & Engines / Java Sound & OpenAL / Re: rmf (beatnik) on: 2005-09-19 04:01:37
Hi,

I'm a mobile sound producer specialized in mobile sound production.
I would like to play a RMF file on targeted mobiles, using JAVA technology, but I can't find any example of a *.java file.
I' m using a  "PlayWav.java" source file and I Have replaced, i the code, the "WAV informations" by "RMF ones" . I built the and packaged the .jar file using the Wireless Toolkit and all seems ok.
Naturally the file didn't paly in the phone emulator because it's not linked to RMF on PC.
It would play  on tergeted phones but I have to test.

Could you tell me if the code below is ok or not: I have changed only the file name/extension and mime type (hilight in red).
if not, could you tell me what to do ?
/*--------------------------------------------------
* PlayWav.java
*-------------------------------------------------*/
import javax.microedition.midlet.*;
import javax.microedition.lcdui.*;
import javax.microedition.media.*;
import java.io.*;
public class PlayWav extends MIDlet implements CommandListener
{
private Display display; // Reference to display object
private Form fmMain; // Main form
private Command cmExit; // Command to exit the MIDlet
private Command cmPlay; // Command to play wav file
public PlayWav()
{
display = Display.getDisplay(this);
// Create commands
cmExit = new Command("Exit", Command.EXIT, 1);
cmPlay = new Command("Play", Command.SCREEN, 2);
// Create Form, add components, listen for events
fmMain = new Form("Play WAV file");
fmMain.addCommand(cmExit);
fmMain.addCommand(cmPlay);
fmMain.setCommandListener(this);
}
public void startApp()
{
display.setCurrent(fmMain);
}
public void pauseApp()
{ }
public void destroyApp(boolean unconditional)
{ }
/*--------------------------------------------------
* Event handling
*-------------------------------------------------*/
public void commandAction(Command c, Displayable s)
{
if (c == cmExit)
{
destroyApp(false);
notifyDestroyed();
}
else if (c == cmPlay)
playwavfile();
}
/*--------------------------------------------------
* Play a wav file
*-------------------------------------------------*/
public void playwavfile()
{
try
{
// Read wav file, packaged in the jar file
InputStream in = getClass().getResourceAsStream("/sexmachine.rmf");
Player p = Manager.createPlayer(in, "audio/rmf");
p.start();
}
catch (Exception e)
{
// Display an alert
Alert alr = new Alert("Error", "Unable to play WAV file!", null, AlertType.ERROR);
alr.setTimeout(Alert.FOREVER);
display.setCurrent(alr, fmMain);
}
}
}



Thank you very much

Jean luc Borla

Pages: [1]
 

Add your game by posting it in the WIP section,
or publish it in Showcase.

The first screenshot will be displayed as a thumbnail.

xsi3rr4x (12 views)
2014-04-15 18:08:23

BurntPizza (11 views)
2014-04-15 03:46:01

UprightPath (24 views)
2014-04-14 17:39:50

UprightPath (10 views)
2014-04-14 17:35:47

Porlus (27 views)
2014-04-14 15:48:38

tom_mai78101 (49 views)
2014-04-10 04:04:31

BurntPizza (108 views)
2014-04-08 23:06:04

tom_mai78101 (207 views)
2014-04-05 13:34:39

trollwarrior1 (176 views)
2014-04-04 12:06:45

CJLetsGame (182 views)
2014-04-01 02:16:10
List of Learning Resources
by Longarmx
2014-04-08 03:14:44

Good Examples
by matheus23
2014-04-05 13:51:37

Good Examples
by Grunnt
2014-04-03 15:48:46

Good Examples
by Grunnt
2014-04-03 15:48:37

Good Examples
by matheus23
2014-04-01 18:40:51

Good Examples
by matheus23
2014-04-01 18:40:34

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:22:30

Anonymous/Local/Inner class gotchas
by Roquen
2014-03-11 15:05:20
java-gaming.org is not responsible for the content posted by its members, including references to external websites, and other references that may or may not have a relation with our primarily gaming and game production oriented community. inquiries and complaints can be sent via email to the info‑account of the company managing the website of java‑gaming.org
Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines | Managed by Enhanced Four Valid XHTML 1.0! Valid CSS!