CaptureDevice question
Hi all. I'm in the middle of writing a java class to handle Internet radio. I'm starting with Shoutcast because the protocol is well documented and there's no shortage of channels to choose from for testing.
So far, my class captures the mp3 stream, decodes the header and writes the output mp3 file to disk as it comes in. Now I'm working on the Studio side and I have a couple of questions.
1. I initially considered using MediaFilePlayerAPI to simply play the mp3 file from disk but I'm concerned that it won't play continually. If the file is still streaming to the hard drive will play() keep playing, or will it simply stop when it hits what it thinks is the end of the file, even though the file has continued to stream since play() was called?
2. Is there any way I can make Sage think the input stream (a JavaSound AudioInputStream) from my java class is a CaptureDeviceInput? That way I could skip the drive writing entirely and just use WatchLive() from CaptureDeviceInputAPI - makes things a LOT simpler. I don't see an exposed API to tell Sage that the AudioInputStream is a CaptureInputDevice so I'm not confident that this can be done, but I'm hoping.
Thanks in advance!
-drin
|