I want to do in-memory converting between audio formats supported by VLC. For instance from MP3 to PCM wave. Because of various reasons (speed, real-time streaming) it is not possible to write the file to disk, convert it and read it back. It all has to be done in memory. I'm not too familiar with the VLC API so this could very well be a trivial question.
From what I can see in this Codeproject article this can be done using a "Memory Renderer" which came in VLC 1.2. However it doesn't say anything about input.
How can I use VLC to do in-memory converting (think System.IO.Stream) of audio formats?
Best case: input (source) and output (destination) is in memory.
Can settle with: Output is in memory.
I have looket at several projects for this. The only one (from what I could see) that requires VLC >=1.2 is VlcDotNet. But again, maybe this feature was there before 1.2?
sout
command as follows:vlc -I dummy -vvv "input.mp3" --sout=#transcode{acodec=s16l,channels=2,ab=128,samplerate=44100}:standard{access=file,mux=wav,dst="output.wav"} vlc://quit
– Countrydancevlc.AddTargetAndPlay(target, options);
using VLCdotNet. – CountrydanceIMemoryRenderer
callback innVLC (.NET C++/CLI binding of libVLC)
looks similar toRenderCallbackAdapter
callback inVLCJ (Java binding of libVLC)
which requires pre-allocated memory frame buffer. However, both are used for direct video rendering, not for audio. You just play the transcoded audio on-the-fly is sufficient enough if you don't want to save it to a file; there is a sout command to perform it. – Countrydance