Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. Java
  4. Hardware

Hardware

Scheduled Pinned Locked Moved Java
javahardwarelearning
10 Posts 5 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    stib_markc
    wrote on last edited by
    #1

    I don't know if this might sound silly, but is it possible to interact with hardware(say an audio card in my case) using Java.

    The master of the art of living makes little distinction between his work and his play, his labor and his leisure, his mind and his body, his education and his recreation, his love and his religion. He hardly knows which is which; he simply pursues his vision of excellence in whatever he does, leaving others to decide whether he is working or playing. To him he is always doing both.

    L J T P 4 Replies Last reply
    0
    • S stib_markc

      I don't know if this might sound silly, but is it possible to interact with hardware(say an audio card in my case) using Java.

      The master of the art of living makes little distinction between his work and his play, his labor and his leisure, his mind and his body, his education and his recreation, his love and his religion. He hardly knows which is which; he simply pursues his vision of excellence in whatever he does, leaving others to decide whether he is working or playing. To him he is always doing both.

      L Offline
      L Offline
      Lost User
      wrote on last edited by
      #2

      Yes, it is possible. However, without a lot more information it's impossible to suggest much more than that. If you have a specific question then please update your post above with the details.

      One of these days I'm going to think of a really clever signature.

      S 1 Reply Last reply
      0
      • S stib_markc

        I don't know if this might sound silly, but is it possible to interact with hardware(say an audio card in my case) using Java.

        The master of the art of living makes little distinction between his work and his play, his labor and his leisure, his mind and his body, his education and his recreation, his love and his religion. He hardly knows which is which; he simply pursues his vision of excellence in whatever he does, leaving others to decide whether he is working or playing. To him he is always doing both.

        J Offline
        J Offline
        Joan M
        wrote on last edited by
        #3

        Richard is 100% right, meanwhile, take a look at this link: http://www.coderanch.com/t/533684/java/java/Java-access-Sound-Card[^] Probably the 6th thread from Carl Worley will help you. Good luck!

        [www.tamautomation.com] Robots, CNC and PLC machines for grinding and polishing.

        S 1 Reply Last reply
        0
        • S stib_markc

          I don't know if this might sound silly, but is it possible to interact with hardware(say an audio card in my case) using Java.

          The master of the art of living makes little distinction between his work and his play, his labor and his leisure, his mind and his body, his education and his recreation, his love and his religion. He hardly knows which is which; he simply pursues his vision of excellence in whatever he does, leaving others to decide whether he is working or playing. To him he is always doing both.

          T Offline
          T Offline
          TorstenH
          wrote on last edited by
          #4

          Sound is a bit of a problem, most of the support has been turned down. But yes, check this: [Java Sound API[^] @ oracle.com

          regards Torsten When I'm not working

          1 Reply Last reply
          0
          • S stib_markc

            I don't know if this might sound silly, but is it possible to interact with hardware(say an audio card in my case) using Java.

            The master of the art of living makes little distinction between his work and his play, his labor and his leisure, his mind and his body, his education and his recreation, his love and his religion. He hardly knows which is which; he simply pursues his vision of excellence in whatever he does, leaving others to decide whether he is working or playing. To him he is always doing both.

            P Offline
            P Offline
            pasztorpisti
            wrote on last edited by
            #5

            In worst case you can implement your interaction in C/C++ modules for each supported platform and you can bind your native code to java via native method calls but thats a lot of work especially if you have a lot of different platforms to support. But you can reach any platform specific functionality from java if you are willing to write some platform specific C/C++ for it. In your case I would go with the sound api the guys already linked if its enough to get the job done.

            S 1 Reply Last reply
            0
            • L Lost User

              Yes, it is possible. However, without a lot more information it's impossible to suggest much more than that. If you have a specific question then please update your post above with the details.

              One of these days I'm going to think of a really clever signature.

              S Offline
              S Offline
              stib_markc
              wrote on last edited by
              #6

              Quote:

              without a lot more information it's impossible to suggest much more than that.

              Yeah, I am sorry, but I have been asked to develop it in Java. I have used C++ before for sound operations using mmioAPIs but this project that I am going to work on contains several modules and one of the module is signal(generated by a digital hardware component) recording and replaying through different channels of a DAC card. Can this be done in Java? Anyway, the GUI of the application software should be written Java. This is must and should. I am new to Java and I use Eclipse IDE. And I didn't down-vote you. Countered.

              The master of the art of living makes little distinction between his work and his play, his labor and his leisure, his mind and his body, his education and his recreation, his love and his religion. He hardly knows which is which; he simply pursues his vision of excellence in whatever he does, leaving others to decide whether he is working or playing. To him he is always doing both.

              L 1 Reply Last reply
              0
              • J Joan M

                Richard is 100% right, meanwhile, take a look at this link: http://www.coderanch.com/t/533684/java/java/Java-access-Sound-Card[^] Probably the 6th thread from Carl Worley will help you. Good luck!

                [www.tamautomation.com] Robots, CNC and PLC machines for grinding and polishing.

                S Offline
                S Offline
                stib_markc
                wrote on last edited by
                #7

                Thank you, I will look into it and get back.

                1 Reply Last reply
                0
                • P pasztorpisti

                  In worst case you can implement your interaction in C/C++ modules for each supported platform and you can bind your native code to java via native method calls but thats a lot of work especially if you have a lot of different platforms to support. But you can reach any platform specific functionality from java if you are willing to write some platform specific C/C++ for it. In your case I would go with the sound api the guys already linked if its enough to get the job done.

                  S Offline
                  S Offline
                  stib_markc
                  wrote on last edited by
                  #8

                  Native methods in Java? I have to learn about them.

                  The master of the art of living makes little distinction between his work and his play, his labor and his leisure, his mind and his body, his education and his recreation, his love and his religion. He hardly knows which is which; he simply pursues his vision of excellence in whatever he does, leaving others to decide whether he is working or playing. To him he is always doing both.

                  P 1 Reply Last reply
                  0
                  • S stib_markc

                    Quote:

                    without a lot more information it's impossible to suggest much more than that.

                    Yeah, I am sorry, but I have been asked to develop it in Java. I have used C++ before for sound operations using mmioAPIs but this project that I am going to work on contains several modules and one of the module is signal(generated by a digital hardware component) recording and replaying through different channels of a DAC card. Can this be done in Java? Anyway, the GUI of the application software should be written Java. This is must and should. I am new to Java and I use Eclipse IDE. And I didn't down-vote you. Countered.

                    The master of the art of living makes little distinction between his work and his play, his labor and his leisure, his mind and his body, his education and his recreation, his love and his religion. He hardly knows which is which; he simply pursues his vision of excellence in whatever he does, leaving others to decide whether he is working or playing. To him he is always doing both.

                    L Offline
                    L Offline
                    Lost User
                    wrote on last edited by
                    #9

                    stib_markc wrote:

                    And I didn't down-vote you.

                    Thanks, but don't worry about it, a few downvotes never hurt anyone. As to your main question I have not looked at the links that the other guys have offered but they may answer your query. I have worked on similar projects in the past and found the best solution was to write the low-level stuff in C/C++ and use the Java Native Interface[^] to access it from the Java application.

                    One of these days I'm going to think of a really clever signature.

                    1 Reply Last reply
                    0
                    • S stib_markc

                      Native methods in Java? I have to learn about them.

                      The master of the art of living makes little distinction between his work and his play, his labor and his leisure, his mind and his body, his education and his recreation, his love and his religion. He hardly knows which is which; he simply pursues his vision of excellence in whatever he does, leaving others to decide whether he is working or playing. To him he is always doing both.

                      P Offline
                      P Offline
                      pasztorpisti
                      wrote on last edited by
                      #10

                      You can declare a static or instance method in java and by applying the native keyword on it you indicate for the compiler that you will provide the implementation with native code, and not in java. Then you have to write a DLL (or more DLLs) that exports the native function(s) with the appropriate names. When you java program starts you have to load the needed DLLs with System.LoadLibrary() before you call the native methods. Example: http://www.javaworld.com/javatips/jw-javatip23.html[^] I would note that you should always try to write as much code in crossplatform java as you can and don't use native methods if you can avoid them because platform dependent stuff defeats the purpose of java.

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups