简体   繁体   中英

Embed metadata in wave-files saved with NAudio

I am working on some software that is able to generate "Single Cycle Waveforms" based on some basic waveforms, and some operations performed on these (simplified). As of now I have added the abillity to import wavefiles (as a "Hand-drawn" waveform) and a simple play-back feature (using NAudio), to let the user listen to the waveforms being generated.

The purpose of generating these waveforms, is to finally export them to external/separate wavefiles ("Single Cycle Waveforms" and/or Wave-tables), so they can be loaded into synthesizers/samplers and used for music-production.

However beside the raw-data (the waveforms) I would like to embed loop-markers (loop-start/end) along with root-key and so on. Anyone know if this is possible with Naudio, and if so how?

WAVE files consist of a series of RIFF chunks. There are two that must be present - the format chunk and the data chunk, but more can be added, and there are some standard ones that might suit your needs. NAudio doesn't have built in support for writing arbitrary chunks, but WaveFileWriter can be overridden to include writing custom chunks. A good example of this is the CueWaveFileWriter class which might actually be useful for your loop markers.

An alternative is to look into creating .sfz files which are supported by many samplers, and is a simple text format that describes how your WAV samples are to be used.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM