Obtaining samples from sound clip

S

Simon

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
 
S

Simon

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
 
A

Andrew Thompson

Simon said:
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.
 
M

Matt Humphrey

Simon said:
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?

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 (e-mail address removed) http://www.iviz.com/
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,582
Members
45,057
Latest member
KetoBeezACVGummies

Latest Threads

Top