• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Liutauras Vilda
  • Paul Clapham
Sheriffs:
  • paul wheaton
  • Tim Cooke
  • Henry Wong
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Piet Souris
Bartenders:
  • Mike London

Sound Input?

 
Ranch Hand
Posts: 191
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi people.

I have a question whicch may seem impossible or just really odd but here goes...

Does java have the capabilities of being able to take in a sound (which is NOT midi) as input consisting of, say, a single note and allow for the programmer to enable it to, say, record its frequency?

Cheers
[ April 17, 2007: Message edited by: Sam Bluesman ]
 
Master Rancher
Posts: 43045
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The recording is not a problem, but determining the frequency really goes into DSP. You could rummage around the numerous examples on this excellent Java audio site, but I'm fairly certain that Java does not have this as a built-in capability.
 
Java Cowboy
Posts: 16084
88
Android Scala IntelliJ IDE Spring Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
A sound rarely has only one frequency. Only a pure sine wave sound has a single frequency. If you sing a certain note then the sound you produce contains a whole range of frequencies.

You could find out the frequency spectrum of a sound by doing spectrum analysis, for example by using an FFT. Advanced digital signal processing algorithms like that are not built-in in the standard Java API, but if you really want to do this, then you can find Java implementations of the FFT online.

Once you have the frequency spectrum of a piece of sound, you could detect what the dominant frequency in the sound is. I don't know how you'd have to do that - it might not be as simple as looking at the highest peak in the spectrum.
[ April 18, 2007: Message edited by: Jesper Young ]
 
reply
    Bookmark Topic Watch Topic
  • New Topic