/* Returns the byte size of the given samples for the format, or a negative error code if unknown format.  */
ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples)
/* Returns the byte size of the given samples for the format, or a negative error code if unknown format.  */
ssize_t snd_pcm_format_size(snd_pcm_format_t format, size_t samples)
{
	int phys_width = snd_pcm_format_physical_width(format);
	if (phys_width < 0)
		return -EINVAL;
	return samples * phys_width / 8;
}