I am using libsndfile (with the c# wrapper) to create wav/aiff files based on existing wav files by for example converting a stereo file to mono file or vice versa.
My process is:
- Read existing file
- Open new file for write while filling LibsndfileInfo
WriteItems into the new file
LibsndfileInfo fInfo = new LibsndfileInfo(); fInfo.Format = info.Format; fInfo.Channels = info.Channels; fInfo.SampleRate = info.SampleRate; IntPtr sndOutFile = api.Open(outfilename, LibsndfileMode.Write, ref fInfo); api.WriteItems(sndOutFile, data, num_items); api.Close(sndOutFile);
While doing that I have noticed that any extra meta data (extra chunks) that were in the origin file are lost in the resulting file.
Is there a way to somehow bringing these extra chunks along or copy the header over to the new file using libsndfile ?
thanks for any input.
Mike