naudio / NAudio

Audio and MIDI library for .NET
MIT License
5.55k stars 1.1k forks source link

Playing MP3 files that are in a zip archive #271

Closed tricotec closed 6 years ago

tricotec commented 6 years ago

Sorry to add this as an issue...seems there is no forum for questions like this. I need to play MP3 files directly from a zip file and do not wish to use the file system to extract them. In the karaoke world, mp3 files are often zipped along with their accompanying CDG file, and it is desireable to play the mp3 and decode the cdg files directly from the zip file. Has this been done? Any idea what the best approach would be? From the sample code it seems obvious that Naudio isn't set up in a way that makes this easy out of the box. Can a stream be used directly instead of using the AudioFileReader? Thanks in advance for any thoughts.

KvanTTT commented 6 years ago

I need to play MP3 files directly from a zip file and do not wish to use the file system to extract them.

Try to use SharpCompress. This library allows extracting archive items in memory without using of file system. NAudio is not a library for working with archives.