Var readr = new RawSourceWaveStream(ms,OLDfmt) Var NEWfmt = new WaveFormat(16000, 16, 1) //tried many Var OLDfmt = WaveFormat.CreateIeeeFloatWaveFormat(16000,1) This chain is not working for me: byte bytes = (Byte)dt.Rows //this is the dataTable from the database query containing the WAV audio If I use Wave32to16Stream on the IEEE float source, it does not error but there is no audio. When I try to convert the IEEE float source to a PCM or upsample it using WaveFormatConversion, it errors out with I can send the IEEE float wav input directly to LameMP3FileWriter but the resulting mp3 stream sounds like a loud hiss seemingly regardless of the output format I use (44100,16,1), (22050,16,1), (11025,16,1). Is there a way to get MediaFoundationEncoder to output an mp3 in some kind of memory object (without a file)?Īlternatively, trying to use the LameMP3FileWriter, which does write to streams, I would like to just skip the file writing step and output to a stream or byte array and write that to the response object. But once that file is written out to the response, though, it's useless. Working with NAudio package, so far what I have working is using MediaFoundationEncoder.EncodetoMp3() to write to a file. I would like to convert that to mp3 on the fly and stream it out via the response object from a WCF service. I have WAV data in IEEE float at 16000Hz, 32-bit, 1-channel format in a byte array (from database).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |