Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsWhite Papers
Discussion GroupsFirst AidDatabasesJavaBeansGUIJava 3DVirtual MachineCORBASecurityToolsGeneral
Java DirectoryOpen Source ProjectsSample Book ChaptersUser GroupsWeb Resources
Related Topics
Databases.NETMore Topics ...

Java Forum / General / September 2006

Tip: Looking for answers? Try searching our database.

Obtaining samples from sound clip

Thread view: 
Simon - 07 Sep 2006 10:05 GMT
I am developing an application where the user can synchronize some events to a
sound clip. I want to visualize the sample data of the clip by just plotting the
wave. However, I am not able to obtain the sample data. Is there any way to
obtain this data using classes from javax.sound.sampled only? If not, what would
be a good library?

Thanks in advance,
Simon
Simon - 07 Sep 2006 13:21 GMT
Ok, I have experimented a little and I can state my question more precisely. I
have used an AudioInputStream to get the sample data. However I have to deal
with things like big/little endian, sample size, etc. myself. Is there some
method available which simply feeds the AudioInputStream into an int[] buffer
containing all the samples? An InputStream (or Iterator or whatsoever) that
returns ints would also be ok. Any ideas?

Cheers,
Simon
Andrew Thompson - 07 Sep 2006 14:00 GMT
> Ok, I have experimented a little and I can state my question more precisely. I
> have used an AudioInputStream to get the sample data. However I have to deal
> with things like big/little endian, sample size, etc. myself. Is there some
> method available which simply feeds the AudioInputStream into an int[] buffer
> containing all the samples?

Not that I am aware.  It would have been handy
when writing AudioTrace..
<http://www.physci.org/test/oscilloscope/>

Andrew T.
Matt Humphrey - 07 Sep 2006 21:53 GMT
> Ok, I have experimented a little and I can state my question more
> precisely. I
[quoted text clipped - 7 lines]
> that
> returns ints would also be ok. Any ideas?

I've seen JMF code to do this, but I don't know if it's the best way for
your AudioInputStream application.  It's in "Swing Hacks" by Marinacci and
Adamson.  They show how to open WAV or PCM media to get PCM samples.

Matt Humphrey matth@ivizNOSPAM.com http://www.iviz.com/


Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.