[Live-devel] Streaming to/from audio devices
Ross Finlayson
finlayson at live555.com
Wed Aug 29 12:52:05 PDT 2018
> Two questions, probably related:
No, they’re not really related (because one question talks about an audio input device; the other about an audio output device).
> 1) Are there any examples of how to use the WindowsAudioInputDevice class (or one of its derivatives)?
No, and to be honest, I don’t know how relevant that code is anymore. (I don’t know if the old Window PCM audio API is still applicable; not many users of our code use Windows anymore.) However, the following old messages (from this mailing list’s archives) might be helpful:
http://lists.live555.com/pipermail/live-devel/2012-October/016076.html
http://lists.live555.com/pipermail/live-devel/2012-May/015104.html
> 2) I'd like to modify the TestMP3Receiver sample client so that it sends received samples directly to an audio output device. In the sample code, the output is defined as a FileSink object created on stdout. What do I replace that with? Can anyone point me in the right direction?
First, unless your OS has a built-in MP3 decoder, you would need to write your own MP3 decoder filter (a subclass of “FramedFilter”) that converts MP3 input into PCM audio output, and insert this between the MP3 stream and the output ‘sink’ object.
As for your audio output device:
- If your output device is represented as a file in the OS’s file system (as is the case in many Unix systems (including Linux)), then you should be able to just use the existing “FileSink” class, without modification.
- Otherwise, you will need to write your own output ‘sink’ object (a subclass of “MediaSink”) that encapsulates your audio output device. The details of how to do this will depend upon your OS.
Ross Finlayson
Live Networks, Inc.
http://www.live555.com/
More information about the live-devel
mailing list