Java-Gaming.org Hi !
Featured games (90)
games approved by the League of Dukes
Games in Showcase (753)
Games in Android Showcase (228)
games submitted by our members
Games in WIP (842)
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  
  How do I get frequency data from a .WAV?  (Read 1684 times)
0 Members and 1 Guest are viewing this topic.
Offline ndnwarrior15
« Posted 2018-01-03 23:26:19 »

What I want to do is create a visual spectrum of a concurrently playing audio file like this

What I've gathered is that I need to read in the samples from the wav file and run a Fourier Transform on it to get a frequency spectrum.
I've done this with code from scratch but the spectrum I'm getting doesn't look right and I would like to find a library to help. Android friendly is preferable but I'll take anything at this point to get me going.

Does anyone know of a library that can do this and possibly something with a basic tutorial?
Offline Riven
Administrator

« JGO Overlord »


Medals: 1336
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #1 - Posted 2018-01-04 00:09:07 »

You could try to understand what the tools do that you're using. (not meant as a snarky remark Smiley)

You're saying you've gathered to read in samples, and apply a FFT on it, and your output looks off.

Did you try to analyze what actually goes wrong? You can feed in a nice sine-wave of a known frequency and actually look at what your FFT spectrum looks like. Does it have a peak at the expected frequency? That's a valuable starting point for troubleshooting, and actually solving the problem step by step.

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Offline ndnwarrior15
« Reply #2 - Posted 2018-01-04 00:51:26 »

Yes I did do that and I understand the value of diving deep into technicalities but I'm trying to make a game not a game engine.

I found what I needed so here it is for those interested.
Games published by our own members! Check 'em out!
Legends of Yore - The Casual Retro Roguelike
Offline philfrei
« Reply #3 - Posted 2018-01-04 19:09:58 »

An excellent, free resource for learning about the FFT is the following eBook:

Scientist and Engineer's Guide to Digital Signal Processing

It starts with the basics, and also contains excellent info about various filtering methods.

The code examples are in BASIC, so you would have to get your Java implementation elsewhere, or build on from the BASIC examples. Perhaps someone at JGO (@nsigma?, @Catharsis?, @ShannonSmith?, others?) has a recommendation or code to share?

It you have difficulties with any part of the text, I've found that a good place to ask questions is the
Signal Processing section of Stack Overflow.

[When asked earlier in a PM, I recommended the OP make a public post, so anyone else that has a similar question could use the answers provided as a reference. We are also requesting this thread be moved to the Java Sound section, if that is not too much trouble.]

music and music apps: http://adonax.com
Offline Riven
Administrator

« JGO Overlord »


Medals: 1336
Projects: 4
Exp: 16 years


Hand over your head.


« Reply #4 - Posted 2018-01-04 23:46:48 »

We are also requesting this thread be moved to the Java Sound section, if that is not too much trouble.]

Moved it to the new board - this was the closest fit (not perfect)

Hi, appreciate more people! Σ ♥ = ¾
Learn how to award medals... and work your way up the social rankings!
Pages: [1]
  ignore  |  Print  
 
 

 
ivj94 (585 views)
2018-03-24 14:47:39

ivj94 (49 views)
2018-03-24 14:46:31

ivj94 (383 views)
2018-03-24 14:43:53

Solater (63 views)
2018-03-17 05:04:08

nelsongames (109 views)
2018-03-05 17:56:34

Gornova (159 views)
2018-03-02 22:15:33

buddyBro (704 views)
2018-02-28 16:59:18

buddyBro (92 views)
2018-02-28 16:45:17

xxMrPHDxx (494 views)
2017-12-31 17:17:51

xxMrPHDxx (734 views)
2017-12-31 17:15:51
Java Gaming Resources
by philfrei
2017-12-05 19:38:37

Java Gaming Resources
by philfrei
2017-12-05 19:37:39

Java Gaming Resources
by philfrei
2017-12-05 19:36:10

Java Gaming Resources
by philfrei
2017-12-05 19:33:10

List of Learning Resources
by elect
2017-03-13 14:05:44

List of Learning Resources
by elect
2017-03-13 14:04:45

SF/X Libraries
by philfrei
2017-03-02 08:45:19

SF/X Libraries
by philfrei
2017-03-02 08:44:05
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!