Java-Gaming.org    
Featured games (78)
games approved by the League of Dukes
Games in Showcase (429)
Games in Android Showcase (89)
games submitted by our members
Games in WIP (468)
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] 2
1  Java Game APIs & Engines / Java Sound & OpenAL / Re: Problem with the SourceDataLine object in MAC OS on: 2008-07-16 13:24:32
Hello,

    I have done in the same way but it behaves differently on the mac Operating System. When i call line.available() it gives me free bytes when whole buffer goes empty.

Regards
2  Java Game APIs & Engines / Java Sound & OpenAL / Problem with the SourceDataLine object in MAC OS on: 2008-07-11 11:22:32
Hello,

     I have written a one program that uses the javax.sound.sampled.SourceDataLine object to play sound. I have tested that program on both MAC and Windows OS.

     On windows OS the program works fine. On MAC OS, the program gives some strange behavior.

     For example, If i have a SourceDataLine buffer of size 50000 bytes. In while loop i am calling available() method of the SourceDataLine. On windows platform, each call in loop give me some available bytes that i can write to buffer. Like 2000, 4000....etc.

   But on MAC OS, i am not getting like that but instead SourceDataLine give me it when all buffer goes empty. I mean i am not getting like 2000,4000 ...etc. but all buffer size like 50000 at once.

  The problem is that i am not able to write data to source data line when it has some small amount of buffer free. Due to this, i am feeling some sound smoothness problem on MAC OS. Sound stops few seconds in between.

Thanks In Advance


 
3  Java Game APIs & Engines / Java Sound & OpenAL / Re: Sound conversion problem using javax.sound...... on: 2008-05-26 08:22:12
Hello,

      Do you know when i can make sound silence? I have PCM_SIGNED data. What i can use 0 OR -1 to make sound silence?
4  Java Game APIs & Engines / Java Sound & OpenAL / Re: Sound conversion problem using javax.sound...... on: 2008-05-23 14:18:31
This is a trial example and not the final code. Hence no improvmemt is done in the code. You can assume Jcount initially zero.
5  Java Game APIs & Engines / Java Sound & OpenAL / Re: Sound conversion problem using javax.sound...... on: 2008-05-23 12:59:41

b = (b * 0)>> 15;  is for left channel, it masks all bits so that left chennel will not have sound.

b = (b * 32768)>> 15; is for right channel. If we increase multiplyer (32768) sound will high on corresponding channel.

Jcount is used just to swith between left and right channel. See.  if(Jcount%2==0){

6  Java Game APIs & Engines / Java Sound & OpenAL / Re: Sound conversion problem using javax.sound...... on: 2008-05-22 14:06:29
Hello,

        i got some success in changing the sound volume and balance by shifting the row bits. Here is the code snap shots

      for(int Icount=0;Icount<size;Icount+=2){
         int b =  ((buffer[Icount+1] << 8 ) | (buffer[Icount] & 0xFF)) & 0xFFFF;
         if(Jcount%2==0){
            b = (b * 0)>> 15;
            Jcount = 1;
         }
         else{
            b = (b * 32768)>> 15;
            Jcount = 0;
         }
         if(b<0){
            out.println(b);
         }
         buffer[Icount] = (byte) (b & 0xff);
         buffer[Icount+1] = (byte) ((b & 0xff00)>>8 );         
      }

This code is in loop where Icount start from 0....buffer.length...

The problem is that it generates some noise.

Can you help me for that?

Thanks and Regards
7  Java Game APIs & Engines / Java Sound & OpenAL / Re: Sound conversion problem using javax.sound...... on: 2008-05-21 14:34:44
Hello,

     Can i change a sound balance by changing a row sound data....? I means bytes of the audio input stream.

Thanks and Regards
8  Java Game APIs & Engines / Java Sound & OpenAL / Re: Sound conversion problem using javax.sound...... on: 2008-05-21 05:49:51
Hello,

 Smiley

I now able to play the MP3 stream.
Here the process what i have done to play that.

I have downloaded the MP3 SPI suggested by you and registered it.  Now, i am generating one WAV file using audio format and audio data sent by the server. I am creating a file that is in same format as windows WAV file format (http://ccrma.stanford.edu/courses/422/projects/WaveFormat/). We can play that generated file using the javax.sound classes.

Another process, if you have a audio data in the file and MP3 SPI registered, you can directly get AudioInputStream using AudioSystem.getAudioInputStream(InputStream stream) method. It automatically analyse the data and determine the format of that data.

Thanks and Regards
9  Java Game APIs & Engines / Java Sound & OpenAL / Re: Sound conversion problem using javax.sound...... on: 2008-05-20 14:32:26
Hello,

        you are correct, lines from the mixer returns individual controls and does not affects other lines.

       But the problem is that it does not set the sound and balance uniformaly, it sets step by step like jumping style.....

Regards
10  Java Game APIs & Engines / Java Sound & OpenAL / Re: Sound conversion problem using javax.sound...... on: 2008-05-20 12:49:21
Hello,

         I have individual lines to play all audio files. Does control from all line behave independently...?
11  Java Game APIs & Engines / Java Sound & OpenAL / Re: Sound conversion problem using javax.sound...... on: 2008-05-20 11:23:05
Hello,

      Thanks for help...

      I have another problem, how i can mix sound balance and volume?. In Java, there are some controls like float control using that i can change volume and balance of the SourceDataLine (javax.sound.sampled). But here i have different situation. I have more than one SourceDataLine opened and all are playing individual audio file (Streams).  I have to changed volume and balance (Sterio sound) of only one stream. I mean balancing effect should come on only one stream, other stream should not get effect of balance and volume.

    If i use Java float control then it would affect all playing streams/file.

   Do you have any idea.....?


Thanks and Regards
12  Java Game APIs & Engines / Java Sound & OpenAL / Re: Sound conversion problem using javax.sound...... on: 2008-05-20 07:25:04
Hello erikd,

       Thanks for suggestion....
       
      Following is a audio format class which i am getting from the server. That represents the format of the data.

                       
                       WaveFormatEX waveFormat = new WaveFormatEX();
         waveFormat.wBitsPerSample = 16;
         waveFormat.nBlockAlign = 1;
         waveFormat.nAvgBytesPerSec = 2000;
         waveFormat.nSamplesPerSec = 11025;
         waveFormat.wFormatTag = 85;    /// What is this ?
         waveFormat.nChannels = 1;      
         waveFormat.cbSize = 12;    // What is this ?
         waveFormat.exData = new byte[12];


Above is one of the data format i am getting.  The sound is some how compressed.
The original file is .wav but when i opened its property it shows Audio Format - MPEG LAYER - 3

Now from above information i want to create javax.sound.sampled.AudioFormat object.

Do you have any suggesting for that...?

Thanks and Regards
13  Java Game APIs & Engines / Java Sound & OpenAL / Re: Sound conversion problem using javax.sound...... on: 2008-05-19 07:09:24
Hello,

      I have one application that originally written in to the C++, that application access the video data from our hand written server. That server work like RTP server. In abstract, server first sends the audio data format (It may be in any format like PCM OR compressed using any of the technique), then sends the audio data in given format. The client application convert that audio data in to PCM if it is not in that format and plays it.

     Know we are converting the client application in to the Java, server application is same, not changed. Hence, we have to achieve same functionality in Java.

 By default windows has in built  API/Functions to convert a different sound format in to PCM format.

 But, how i can do that in java.....?


Thanks and Regards
14  Java Game APIs & Engines / Java Sound & OpenAL / Re: Sound conversion problem using javax.sound...... on: 2008-05-17 06:59:04
Hey, There is no solution for this problem...?
15  Java Game APIs & Engines / Java Sound & OpenAL / Sound conversion problem using javax.sound...... on: 2008-05-13 12:10:24
   
Hello,

I have a situation, i have data and source sound format. For example, if i wand to process .MP3 file then format of the data like bitRate, sample rate, channels etc. have in the one object (You can consider that object as like simple object containing getter/setter for all properties). And, all related data in another object/file (Like in byte array). I have both format and data separate not in same file like normal .MP3 file.

Know i want to convert that data in to PCM format so that i can play using the javax.sound..... package classes....

If any one have idea then its most welcome.
Any help would be appreciated.....

Thanks In Advance
16  Java Game APIs & Engines / JOGL Development / Re: Announcing: joglutils project on: 2008-05-05 07:44:39
I have downloaded same .3ds from the net and tried to load it using joglutils. Programs runs without no error but does not shows any scene in the window.
17  Java Game APIs & Engines / JOGL Development / JOGL Native JNI source code on: 2008-03-28 11:17:54
Hello,
 
         Can any one tell me where i can find native source code for JOGL..?

Thanks and Regards
Vinod Patel
18  Java Game APIs & Engines / JOGL Development / Rendering problem while calling native methods on: 2008-03-27 07:36:03
Hello,

     I am calling native method from the Java Code to create one native Window and then initializing the OpenGL to render on the created window. I am able to create a window, OpenGL context, renderer context etc. OpenGL also clears the color but not render the line i have drawn. here is the code for the same...

JNIEXPORT void drawBox(void)
{
   glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT );      // Clear The Screen And The Depth Buffer

   glColor4f(1,1,1,1);

   glBegin(GL_LINE);                  // Drawing Using Triangles
      glVertex3f( 1.0f, 1.0f, 0.0f);            // Top
      glVertex3f(500.0f,500.0f, 0.0f);            // Bottom Left
      //glVertex3f( 1.0f,-1.0f, 0.0f);            // Bottom Right
   glEnd();   

}

JNIEXPORT void init(void)
{

    /* Use depth buffering for hidden surface elimination. */
   glEnable(GL_DEPTH_TEST);                  // Enables Depth Testing
   glDepthFunc(GL_LEQUAL);   

   glViewport(0,0,500,500);
   glMatrixMode(GL_PROJECTION);    // Select The Projection Matrix
   glLoadIdentity();
   glOrtho(0,500, 0,500, -1, 1);
   glMatrixMode(GL_MODELVIEW);
   glLoadIdentity();

   glClearColor(1,0,0,0);

}

JNIEXPORT int main(int argc, char **argv)
{
   init();
  while(true){
        f_wglMakeCurrent(m_DeviceContext,m_RenderContext);
      drawBox();
      SwapBuffers(m_DeviceContext);
      f_wglMakeCurrent(NULL,NULL);
      ::Sleep(2000);

  }

  return 0;
}

Hilighted area with red color works properly.

Any help would be appreciated.......

Thanks In Advance.....
19  Java Game APIs & Engines / JOGL Development / Re: zbuffering issue... on: 2008-03-01 07:47:53
Hello,

         I have set the depth test less equal but although it giving me same problem.

Thanks
20  Java Game APIs & Engines / JOGL Development / zbuffering issue... on: 2008-02-28 07:17:43
Hello,

       I have created one animation. In animation, i see some weird effects in the animation. What happens is that when i play animation, objects are transfered back and front. Means, hidden objects come to front and front objects goes back...

     Any help would be appreciated...

Thanks In Advance
21  Java Game APIs & Engines / Java Sound & OpenAL / PBuffers/Off Screen Rendering... on: 2008-02-23 07:42:53

Hello,

   This is a jogl forum and i am using a JOGL forum, but i want to do some task nativly and thus asking for the OPENGL stuf....
   If any one can explain me then it would be greate useful to me...

Thanks and Regards
22  Java Game APIs & Engines / Java Sound & OpenAL / PBuffers/Off Screen Rendering... on: 2008-02-22 13:40:17
Hello To All,

           I want to know what is a pBuffer and for what purpose i can use it.? Can any one explain me using simple example. Also, what is offscreen rendering?

Thanks To All In Advance
23  Java Game APIs & Engines / JOGL Development / OpenGL calls using JavaScript/Ajax on: 2007-12-19 10:30:28
Hello,

      Is there any way to make OpenGL call from the JavaScript / Ajax. I want to write a OpenGl rendered in JavaScript.

Thanks In Advance
24  Java Game APIs & Engines / JOGL Development / Animation display changes on each run... on: 2007-11-20 10:32:16
Hello,

       Recently, i have found new problem in my application. I am playing same animation each time although it does not give same output.

      If i have a 400 x 400 GLCanvs then sometimes it display in 200 x 200 area while sometime in 400 x 400 area.

      What could be a reason? Is it problem of Scale property etc...

Thanks In Advance
25  Java Game APIs & Engines / JOGL Development / Re: Difference between two... on: 2007-10-24 06:58:39
this kind of facility is not available in current version of JOGL or any FUTURE release.
If we can do using native call then also it is fine.
26  Java Game APIs & Engines / JOGL Development / Difference between two... on: 2007-10-23 11:01:03
Hello,

      What is difference between this two...?

        hdc = GetDC(hwnd); and hdc = GetDC(NULL);

     can i do same in JOGL and How?

Thank and Regards
       
27  Java Game APIs & Engines / JOGL Development / Render anywhere using JOGL/OpenGL on: 2007-10-16 08:52:03
Hello,
 
      I am doing some research to render a 3D character anywhere, i mean on desktop, On explorer screen etc. I does not want to use canvas, OR if i use it then, i do not want to show it to user. The user should feel that there is only character on Browser or desktop and nothing else.

Any help would be appreciated

Thanks and Regards
28  Java Game APIs & Engines / JOGL Development / Re: GUI blocks when calling method on GUI on: 2007-10-16 06:00:57
Hello bleb,

           I am using an animator class of JOGL. I think that one of the thread is normal awt thread and another one is a thread for animtor.

          In stack trace "AWT-EventQueue-2" is showing method of my application and "AWT-EventQueue-1" (Second Stack Trace) is shoowing methods of system related activities.


         I think "AWT-EventQueue-2" (First Stack Trace) is a thread for animator of JOGL.

Thanks and Regards
29  Java Game APIs & Engines / JOGL Development / Re: GUI blocks when calling method on GUI on: 2007-10-15 14:05:35
       Error is only comming on the linux platform and not on others.
30  Java Game APIs & Engines / JOGL Development / Re: GUI blocks when calling method on GUI on: 2007-10-15 08:28:01
Hello lhkbob,

               Here, i am pasting a stack trace of delocked threads.

Deadlock found :-
"AWT-EventQueue-2" Id=27 in BLOCKED Time =-1 on lock=java.awt.Component$AWTTreeLock@1f78040
     owned by AWT-EventQueue-1 Id=12
    at java.awt.Component.getGraphicsConfiguration(Component.java:815)
    at com.qedsoft.renderer.abstractfile.renderer.impl.CQ3DRendererOpenGL.makeCurrent(CQ3DRendererOpenGL.java:1341)
    at com.qedsoft.renderer.abstractfile.renderer.impl.CQ3DRendererOpenGL.beginRendererContext(CQ3DRendererOpenGL.java:1325)
    at com.qedsoft.q3dplayer.extended.impl.CQ3DPlayerExtended.beginRendererContext(CQ3DPlayerExtended.java:114)
    at com.qedsoft.realstreamlib.impl.CQ3DRealStream.beginRendererContext(CQ3DRealStream.java:1365)
    at com.qedsoft.realstreamlib.impl.QEDThreadPlayer.run(QEDThreadPlayer.java:30)
    at com.qedsoft.player.impl.CRealStreamPlayer.display(CRealStreamPlayer.java:111)
    at com.sun.opengl.impl.GLDrawableHelper.display(GLDrawableHelper.java:78)
    at javax.media.opengl.GLCanvas$DisplayAction.run(GLCanvas.java:324)
    at com.sun.opengl.impl.GLDrawableHelper.invokeGL(GLDrawableHelper.java:194)
    at javax.media.opengl.GLCanvas$DisplayOnEventDispatchThreadAction.run(GLCanvas.java:341)
    at java.awt.event.InvocationEvent.dispatch(InvocationEvent.java:199)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:461)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)

"AWT-EventQueue-1" Id=12 in BLOCKED Time =-1 on lock=java.lang.Class@50988
     owned by AWT-EventQueue-2 Id=27
    at sun.java2d.loops.DrawGlyphListAA.DrawGlyphListAA(Native Method)
    at sun.java2d.pipe.AATextRenderer.drawGlyphList(AATextRenderer.java:36)
    at sun.java2d.pipe.GlyphListPipe.drawChars(GlyphListPipe.java:85)
    at sun.java2d.pipe.ValidatePipe.drawChars(ValidatePipe.java:160)
    at sun.java2d.SunGraphics2D.drawChars(SunGraphics2D.java:2720)
    at com.sun.java.swing.SwingUtilities2.drawChars(SwingUtilities2.java:609)
    at javax.swing.text.Utilities.drawTabbedText(Utilities.java:159)
    at javax.swing.text.Utilities.drawTabbedText(Utilities.java:89)
    at javax.swing.text.PlainView.drawUnselectedText(PlainView.java:137)
    at javax.swing.text.PlainView.drawElement(PlainView.java:96)
    at javax.swing.text.PlainView.drawLine(PlainView.java:65)
    at javax.swing.text.PlainView.paint(PlainView.java:288)
    at javax.swing.plaf.basic.BasicTextUI$RootView.paint(BasicTextUI.java:1338)
    at javax.swing.plaf.basic.BasicTextUI.paintSafely(BasicTextUI.java:643)
    at javax.swing.plaf.basic.BasicTextUI.paint(BasicTextUI.java:781)
    at javax.swing.plaf.synth.SynthTextAreaUI.paint(SynthTextAreaUI.java:109)
    at javax.swing.plaf.synth.SynthTextAreaUI.update(SynthTextAreaUI.java:104)
    at javax.swing.JComponent.paintComponent(JComponent.java:743)
    at javax.swing.JComponent.paint(JComponent.java:1006)
    at javax.swing.JComponent.paintChildren(JComponent.java:843)
    at javax.swing.JComponent.paint(JComponent.java:1015)
    at javax.swing.JViewport.paint(JViewport.java:728)
    at javax.swing.JComponent.paintChildren(JComponent.java:843)
    at javax.swing.JComponent.paint(JComponent.java:1015)
    at javax.swing.JComponent.paintChildren(JComponent.java:843)
    at javax.swing.JComponent.paint(JComponent.java:1015)
    at javax.swing.JComponent.paintChildren(JComponent.java:843)
    at javax.swing.JComponent.paint(JComponent.java:1015)
    at javax.swing.JLayeredPane.paint(JLayeredPane.java:559)
    at javax.swing.JComponent.paintChildren(JComponent.java:843)
    at javax.swing.JComponent.paintWithOffscreenBuffer(JComponent.java:4979)
    at javax.swing.JComponent.paintDoubleBuffered(JComponent.java:4925)
    at javax.swing.JComponent.paint(JComponent.java:996)
    at java.awt.GraphicsCallback$PaintCallback.run(GraphicsCallback.java:21)
    at sun.awt.SunGraphicsCallback.runOneComponent(SunGraphicsCallback.java:60)
    at sun.awt.SunGraphicsCallback.runComponents(SunGraphicsCallback.java:97)
    at java.awt.Container.paint(Container.java:1709)
    at sun.awt.RepaintArea.paintComponent(RepaintArea.java:248)
    at sun.awt.X11.XRepaintArea.paintComponent(XRepaintArea.java:56)
    at sun.awt.RepaintArea.paint(RepaintArea.java:224)
    at sun.awt.X11.XComponentPeer.handleEvent(XComponentPeer.java:645)
    at java.awt.Component.dispatchEventImpl(Component.java:4044)
    at java.awt.Container.dispatchEventImpl(Container.java:2024)
    at java.awt.Window.dispatchEventImpl(Window.java:1778)
    at java.awt.Component.dispatchEvent(Component.java:3803)
    at java.awt.EventQueue.dispatchEvent(EventQueue.java:463)
    at java.awt.EventDispatchThread.pumpOneEventForHierarchy(EventDispatchThread.java:242)
    at java.awt.EventDispatchThread.pumpEventsForHierarchy(EventDispatchThread.java:163)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:157)
    at java.awt.EventDispatchThread.pumpEvents(EventDispatchThread.java:149)
    at java.awt.EventDispatchThread.run(EventDispatchThread.java:110)


   Please let me know if you could find any reason for dead lock.
   Deadlock comes only when i switch between any window or minimize and maximize it. I think that it occurs when any GUI event occurs.

Thanks and Regards
Pages: [1] 2
 

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

The first screenshot will be displayed as a thumbnail.

theagentd (6 views)
2014-04-24 23:00:44

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

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

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

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

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

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

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

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

trollwarrior1 (216 views)
2014-04-04 12:06:45
List of Learning Resources
by SHC
2014-04-18 03:17:39

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
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!