The Artima Developer Community
Sponsored Link

Legacy Java Answers Forum
November 2001



This page contains an archived post to the Java Answers Forum made prior to February 25, 2002. If you wish to participate in discussions, please visit the new Artima Forums.


Reading from a cd

Posted by Matt Gerrans on November 27, 2001 at 4:40 AM

Often, when a music CD is played on a PC, the hardware is doing the playing (actually, this may be less the case now, than it was when CD drives first appeared in PCs). Nevertheless, you can read the data, but it is in a form similar to a windows wav file format, which is a simple uncompressed audio stream. (This may also be the same format as an au file on Unix, but I'm not certain about that).

However, as far as the CD access stuff (enumerating drives and determining drive types), I think you are once again in the platform-specific realm and will have to use JNI and C/C++. I've done this stuff in C++ with Windows API, but I don't think you'll find any of this kind of thing in the Java APIs -- maybe there are third-party libraries (hopefully supporing major OSes) that would do the JNI work for you...

- mfg

> I know that this question isn't directly related to java (though it is indirectly since I plan to do this using java), but does anyone know how to read music from a cd? I'm assuming that reading data file from a cd is equivalent to reading from the hard disk (in terms of accessing the data using software, not accessing it from the perspective of hardware). But how do I get my program to access the audio data? I can't just open up a .cda file since those files aren't equivalent to mp3 files and such in that they hold the actual audio data. Also, I've searched on the Internet, and I've found stuff that explains how the hardware reads from the cd (using lasers and such), which is pretty interesting, but my question is essentially, how do I access the audio data that the laser has read? If anyone knows how I can do this, or has any links, I would greatly appreciate it. Thnx in advance!
> Hiran


Sponsored Links

Copyright © 1996-2009 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use - Advertise with Us