I am trying to edit a very short sound effect from freesound.org (https://www.freesound.org/people/KorgMS2000B/sounds/54405/). When I import it into Audacity and try to play it, it does not play anything, though. It seems that the audio clip is too short to be played back properly. When I put another audio clip half a second after it, it does play the sound correctly. When I simply select a larger area to play, it strangely only plays it sometimes. Both of these half-baked solutions are very annoying, though, because the timeline scrolls to the end of the section every time I play it. Apart from that I can not hear the sound when trying to apply an effect and clicking on the preview button. Does Audacity have a problem with very short audio clips like that?
It’s almost certainly due to buffering by the sound system.
It is likely to be most noticeable when using the default playback (Pulse). If you select the “hw” playback option in the device toolbar, then Audacity will bypass Pulse and use ALSA directly. That should improve things, but it won’t cure the issue completely because ALSA also uses buffering (though typically less than Pulse).
To cure the issue completely you would need to use Jack Audio system, though it can be quite tricky setting that up, so may not be worth the effort.
It’s partly an Audacity issue too because Audacity also buffers the audio data, and it’s partly a hardware / drivers issue. With some combination of hardware / drivers / sound system, if playback ends before all of the various buffers are full, then the sound card may not even try to play the audio, and the data in the buffers will just be dumped. With other combinations, the sound card will play until the buffers have been emptied. With low latency sound systems such as Jackd and ASIO, there should be no problem because the total buffer size is extremely small, and playback should continue until the buffers are completely empty. It’s not an issue that Audacity can do anything about because high latency sound systems will stutter or not play at all unless there is sufficient buffering by the software. (When using Jackd, the buffering by Audacity appears to be automatically bypassed. I’ve not tested that with ASIO, but probably the same there too.)
I tried what you suggested and set the output directly to ALSA with the corresponding audio device. Unfortunately, it did not change anything for me.
So I guess I would have to set up JACK and see if I get better results. I have done that before, but I suspect it would take me some time nonetheless. I am going to think about it and report my results if I decide to go for it.