Read, Add, Edit and Write Loop and Cue markers to Wav

Another update. I’ve managed to implement this idea! But since I’m not experienced as a programmer, everyone should be warned about the possibility of errors in the code I’ve added. All my changes should be reviewed by someone competent. Please try it out, but it’s on your own risk…

I’ve done all development on a Ubuntu 11.04 (32 bit) computer. I compiled the wxWidgets myself, but I only managed to get Audacity to compile if I used the unicode version of wx. The version of wx that’s in the repositiories should work also.

The steps to create a loop/cue aware Audacity build are:

  • Get the source code for Audacity (with subversion)
  • Install all dependencies and tools for building Audacity
  • Exchange some files in libsndfile folder (AudacityFolder/lib-src/libsndfile/src) that I’ve modified so that cue markers can be handled with libsndfile
  • Exchange the AudacityFolder/src/export/ExportPCM.cpp to my version
  • Exchange the AudacityFolder/src/import/ImportPCM.cpp to my version
  • Configure Audacity to use local libsndfile (I used a line like ./configure --prefix=/home/lars/audacity --with-libsndfile=local --with-libsamplerate --with-libid3=no --with-ffmpeg=no but you can modify it to suit your needs)
  • execute make and make install (since I used the prefix in the configure I don’t have to use sudo make install and since this is a highly experimental build…)

The files in the attached archive changedSRC.tar.bz2 should to into libsndfile/src, and the textfiles should loose the .txt suffix and go into respective folder as indicated above.

When I use this feature I always sync/lock the tracks and set the snap to samples in Audacity.

Again, be warned that you try this on your own risk! It works for me and it would be great to hear what others think. What’s nice is that one can handle up to 15 loops in one wav and up to 10 cue markers (due to current limitations in libsndfile). This is still much better than many other audio editors. Wavosaur for instance can only have one loop. Audacity is a really fantastic piece of software!

Kind regards
ImportPCM.cpp.txt (21.3 KB)
ExportPCM.cpp.txt (26 KB)
changedSRC.tar.bz2 (42.8 KB)