| View previous topic :: View next topic |
| Author |
Message |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Sat Oct 02, 2010 1:05 pm Post subject: [Java Question]How to retrieve frequency of point in audio |
|
|
Hey guys I'm in need of some help or ideas in a new project i'm working on. The first thing i need to figure out how to do is get the frequency of any point in an audio file (mp3, wav, not midi). What is the best way to go about this? I read that midi might be the best way to go since it's easy to retrieve the frequency, but the input files wouldn't be midi, they would preferably be .mp3 or something that can be converted from .mp3 very easily.
If i need to elaborate anymore, let me know. Thanks
_________________
|
|
| Back to top |
|
 |
tombana Master Cheater
Reputation: 2
Joined: 14 Jun 2007 Posts: 456 Location: The Netherlands
|
Posted: Sat Oct 02, 2010 2:21 pm Post subject: |
|
|
MP3 files are compressed, so to access the raw audio data your program will have to convert it to a raw uncompressed format like WAV anyways. I'd just find some audio conversion library and use that.
From thereon you can open the WAV file and analyze it's data. You can google 'wave file format' for information about that. Example: https://ccrma.stanford.edu/courses/422/projects/WaveFormat/
EDIT: I continued reading about that format, and discovered that the raw data are 'samples' which are not directly frequencies. So I guess that the link of 'justa_dude' would be more helpful.
Last edited by tombana on Sat Oct 02, 2010 2:31 pm; edited 1 time in total |
|
| Back to top |
|
 |
justa_dude Grandmaster Cheater
Reputation: 23
Joined: 29 Jun 2010 Posts: 893
|
Posted: Sat Oct 02, 2010 2:21 pm Post subject: |
|
|
If you're reading the raw files, the process is going to depend very much on the encoding. I suggest you look at existing libraries, especially those with spectrum analyzers or mp3 visualization tools.
There's a pretty good walkthrough for making a spectrum analyzer in Java here.
Cheers
|
|
| Back to top |
|
 |
Jorg hi I post too much
Reputation: 7
Joined: 24 Dec 2007 Posts: 2276 Location: Minnesota
|
Posted: Sat Oct 02, 2010 9:12 pm Post subject: |
|
|
Java is a high platform language, but this is just one of its cons.
_________________
CEF will always stay alive. |
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Sat Oct 02, 2010 11:13 pm Post subject: |
|
|
| Jorghi wrote: | | Java is a high platform language, but this is just one of its cons. |
Why do you say that...I feel like it is very possible to do. The only reason Java doesn't include a lot of useful functionality is because it's not portable to other systems, mp3 or wav is independent of the system and therefore it should be able to be done...I just don't know how to do it yet
btw if you're wondering what my project is, i'm trying to create a program that synthesizes music based on genetic recombination and learning.
_________________
|
|
| Back to top |
|
 |
justa_dude Grandmaster Cheater
Reputation: 23
Joined: 29 Jun 2010 Posts: 893
|
Posted: Sun Oct 03, 2010 1:35 am Post subject: |
|
|
| You should probably check out csound, too. I'd imagine there's a Java port around somewhere.
|
|
| Back to top |
|
 |
HomerSexual Grandmaster Cheater Supreme
Reputation: 5
Joined: 03 Feb 2007 Posts: 1657
|
Posted: Sun Oct 03, 2010 12:16 pm Post subject: |
|
|
the Shazam thing is very very vague, ugh. I'm working on it though. Will check out alternatives
_________________
|
|
| Back to top |
|
 |
|