I have been using Audacity for over a year now but yesterday had a strange problem which never happened before.
I imported in a WAV file and proceeded to edit out a porption of the file. I then exported the result to WAV as I usually do.
But when I played back the exported file, the volume was so loud it clipped and caused tremendous distortion. When I imported this file back into Audacity to view it, I can see by the waveform that the peaks far exceeded 0db.
If you did your edit totally visually (i.e. never played the WAV during the edit), it is possible that you had inadvertently raised the gain on the track. The waveform does not change to reflect the new gain level. This is, in my opinion, a serious weakness of Audacity. It makes it possible to produce clipping and not be aware of it until after the export has been done.
Tracks may be “mixed down” before exporting (Tracks menu > Mix and Render). This will “render” the track gain and any Envelopes so that you can see the mix before you export (recommended for multi-track projects).
If you “Mix and Render” before Export and have “Show clipping” enabled then red vertical lines will appear if there is any clipping.
For single track recordings (or mixed down multitrack recordings) it is highly recommended to apply either the Amplify or Normalize effects before Exporting. Both of these effects will try to stop users from ruining their show.
A foolproof method to make accidentally clipping on export would be to make “Amplify” or “Normalize” a compulsory step of the Export process, but that would add a couple of mouse clicks to every Export, would require user interaction for each file with “Export Multiple”, would roughly double the time taken to export (a real annoyance for long recordings) and I expect would be highly unpopular.
Protecting novice users from user error is often very difficult without impeding the work-flow for more experienced users and can also deny novice users the opportunity to gain experience. There needs to be a balance and in Audacity a lot of thought and effort goes into making the program as easy to use as possible while still providing power and flexibility for users that want to do more.
What probably happened is that, just prior to export, I clicked somewhere to the left of the track to highlight the track. I must have inadvertently moved that gain slider which I was not aware of and did not pay any attention to. Now I am aware of it and will not make that blunder again.