ProgrammingThis forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.
Notices
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
Hello,
I'm trying to develop a small piece of code that shows waveforms
of a song while playing it.
My idea is this: precompute all values of all I want to display
while loading audio (in other words: build an offscreen image or
a similar object), then display the current part and scroll this
while playing..
However, I cannot find what library calls could help me to do
this in an *efficient* way, considering that all output should
be directed to an X Window or to a gtk widget like gtk drawing
area..
Any suggestions (opengl? direct rendering?)?
Thanks,
gaetano
1. I read x lib documentation and a programming book. However, X pixmaps seems to be limited in
memory to use as offscreen widgets, and I can't find a way to do something like scrolling
directly.
2. I cannot think java as an efficient way, because of its interpreter nature..
2. I cannot think java as an efficient way, because of its interpreter nature..
if the only thing restricting you from using java is that opinion.. then it may be worth your while to look into how java performs in reality compared to the how it performs in opinions.
My pc is an old pentium celeron 600, so my opinion is empirically demonstrated every time
I look for a serious java project that involves multimedia.
An interpreter language run slower than a native language, in theory, and in practice this
difference become more evident when you want your pc do something that need a lot of resources
(multimedia, for example).
Or do you think that games like doom could be developed in java?
It is the cost we have to pay for its strength, portability.
Every language could be a solution for something, so when operating systems are developed
in c, c++, and assembly, java could be the best solution for rapid application developmnent
where portability is an important factor and performance a minor.
i dont want to get into yet another discussion on java performance vs native languages. i am only be suggesting that rendering a waveform is far from a computationally intensive operation. just because you are playing audio and drawing some 2d graphics to the screen while doing it, dont lump it in with actual multimedia processing.
imo, if programmed efficiently, java would have no problem doing this. but in the end there are hundreds of ways to do it, mine was only a suggestion..
(btw, if you would want to check it out, look at the javax.sound package)
Even if java could work well in this situation in my old pc,
the situation I represent here is an example of what I have to do.
I have to add something to what I describe, but
because the problem (almost for now) is in the visual representation
of the waveform, I build this example.
However, if java could do this well, and because java is build on top
of linux and X, than there is a good way to do this even without java.
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.