Java-Gaming.org    
Featured games (79)
games approved by the League of Dukes
Games in Showcase (476)
Games in Android Showcase (106)
games submitted by our members
Games in WIP (531)
games currently in development
News: Read the Java Gaming Resources, or peek at the official Java tutorials
 
    Home     Help   Search   Login   Register   
Pages: [1]
  ignore  |  Print  
  Visualising sound  (Read 1906 times)
0 Members and 1 Guest are viewing this topic.
Offline Oolong

Junior Newbie





« Posted 2005-12-05 18:17:39 »

Hello,

 Does anyone have any experience with visualising sounds based on microphone input (or CDs, or whatever), preferably in an applet? I'm just trying to figure out where to start, really. It doesn't need to do anything complicated in terms of analysing the signal, I mostly just want to grab bits of the waveform and use them to make a display. I might also want to do something with the overall volume of the incoming sound.

 I thought I'd surely be able to find some sample code somewhere to get an idea how it can work, but I can't seem to find anything remotely similar! This may be because I'm being dense, I just don't know.

 Anyway - any thoughts or helpful links would be much appreciated - I'm okay for general-purpose documentation of Java Sound, I just have nothing about using sound to make anything besides more sound!

 Is Java Sound pretty much my only option for this, without expecting my visitors to download a plugin? I will soon be wanting to output sound, as well, if that makes a difference.

Cheers

 - f.
Offline erikd

JGO Ninja


Medals: 16
Projects: 4
Exp: 14 years


Maximumisness


« Reply #1 - Posted 2005-12-06 13:29:06 »

When you get sound input, you get chunks of data which you can directly render to screen. Just translate the amplitudes to Y coordinates and draw them along an X axis. How you have to translate the samples to Y coordinates depends on the format you're receiving the samples (8 or 16 bits, byte order). You might want to average a few samples otherwise you'll have a lot of drawing to do. Average more samples do create an overal volume indicator.

Offline Oolong

Junior Newbie





« Reply #2 - Posted 2005-12-07 10:41:14 »

Thanks erikd.

I'm a little troubled by not being able to find anything similar that anyone else has done - it seems like such an obvious thing to do that its absence makes me wonder if there's some good reason why it won't work right...!
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline sunet2000

Senior Newbie




I want my mumart account back!


« Reply #3 - Posted 2005-12-19 22:45:36 »

I wrote a simple analogue VU-meter a couple of years ago. It captures the soundcard's recording device.

http://geocities.com/sunet2000/vumeter.jar

You can run it as an application. You need to use a signed applet to record from the sound card, if I remember correctly.
Pages: [1]
  ignore  |  Print  
 
 
You cannot reply to this message, because it is very, very old.

 

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

The first screenshot will be displayed as a thumbnail.

pw (13 views)
2014-07-24 01:59:36

Riven (13 views)
2014-07-23 21:16:32

Riven (13 views)
2014-07-23 21:07:15

Riven (14 views)
2014-07-23 20:56:16

ctomni231 (43 views)
2014-07-18 06:55:21

Zero Volt (39 views)
2014-07-17 23:47:54

danieldean (32 views)
2014-07-17 23:41:23

MustardPeter (35 views)
2014-07-16 23:30:00

Cero (50 views)
2014-07-16 00:42:17

Riven (50 views)
2014-07-14 18:02:53
HotSpot Options
by dleskov
2014-07-08 03:59:08

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:58:24

Java and Game Development Tutorials
by SwordsMiner
2014-06-14 00:47:22

How do I start Java Game Development?
by ra4king
2014-05-17 11:13:37

HotSpot Options
by Roquen
2014-05-15 09:59:54

HotSpot Options
by Roquen
2014-05-06 15:03:10

Escape Analysis
by Roquen
2014-04-29 22:16:43

Experimental Toys
by Roquen
2014-04-28 13:24:22
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!