naudio / NAudio

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

Destination driven resample #644

Open lordrak007 opened 4 years ago

lordrak007 commented 4 years ago

Hello, i have any idea hot to solve encoding from tile to stream. I have event which is faired when wants specific size of data. So i know destination sample size what i need to send. I have no idea how to solve this. For example i have mp3 and i need wav of sample size 100 to be send. Thanks anyone

markheath commented 4 years ago

Just use Mp3FileReader, and in the call to Read, ask for the number of bytes you need (e.g. for 100 samples in a stereo MP3 file that would be 100 2channels 2bytes_per_sample = 400 bytes)