Cheat Engine Forum Index Cheat Engine
The Official Site of Cheat Engine
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 


[Java Question]How to retrieve frequency of point in audio

 
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming
View previous topic :: View next topic  
Author Message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Sat Oct 02, 2010 1:05 pm    Post subject: [Java Question]How to retrieve frequency of point in audio Reply with quote

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
View user's profile Send private message
tombana
Master Cheater
Reputation: 2

Joined: 14 Jun 2007
Posts: 456
Location: The Netherlands

PostPosted: Sat Oct 02, 2010 2:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
justa_dude
Grandmaster Cheater
Reputation: 23

Joined: 29 Jun 2010
Posts: 893

PostPosted: Sat Oct 02, 2010 2:21 pm    Post subject: Reply with quote

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
View user's profile Send private message
Jorg hi
I post too much
Reputation: 7

Joined: 24 Dec 2007
Posts: 2276
Location: Minnesota

PostPosted: Sat Oct 02, 2010 9:12 pm    Post subject: Reply with quote

Java is a high platform language, but this is just one of its cons.
_________________
CEF will always stay alive.
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Sat Oct 02, 2010 11:13 pm    Post subject: Reply with quote

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 Razz

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
View user's profile Send private message
justa_dude
Grandmaster Cheater
Reputation: 23

Joined: 29 Jun 2010
Posts: 893

PostPosted: Sun Oct 03, 2010 1:35 am    Post subject: Reply with quote

You should probably check out csound, too. I'd imagine there's a Java port around somewhere.
Back to top
View user's profile Send private message
HomerSexual
Grandmaster Cheater Supreme
Reputation: 5

Joined: 03 Feb 2007
Posts: 1657

PostPosted: Sun Oct 03, 2010 12:16 pm    Post subject: Reply with quote

the Shazam thing is very very vague, ugh. I'm working on it though. Will check out alternatives
_________________
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Cheat Engine Forum Index -> General programming All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum
You cannot attach files in this forum
You can download files in this forum


Powered by phpBB © 2001, 2005 phpBB Group

CE Wiki   IRC (#CEF)   Twitter
Third party websites