I’d like write cues (i.e. time-based markers, not ID3-like tags) to a WAV file with C#. It seems that the free .NET audio libraries such as NAudio and Bass.NET don’t support this.
I’ve found the source of Cue Tools, but it’s entirely undocumented and relatively complex. Any alternatives?
Here’s a link that explains the format of a
cuechunk in a WAV file:http://www.sonicspot.com/guide/wavefiles.html#cue
Because a WAV file uses the RIFF format, you can simply append the
cuechunk to the end of an existing WAV file. To do this in .Net, you would open aSystem.IO.FileStreamobject, using the constructor that takes a path and aFileMode(you would useFileMode.Appendfor this purpose). You would then create aBinaryWriterfrom yourFileStream, and use it to write the cue chunk itself.Here is a rough code sample to append a
cuechunk with a single cue point to the end of a WAV file:Note: I have never used or tested this code, so I am not sure if it works quite right. It is just intended to give you a rough idea of how to write this in C#.