Using ALSA to play audio, after calling snd__pcm__writei, can I free the sound sample buffer right away or do I need to wait until the sound is finished playing before I can free the sample buffer?
For example:
unsigned short *buffer;
buffer = malloc(size of sample to play);
...load data into buffer...
snd_pcm_writei (playback_handle, buffer, size of sample)
free(buffer)