snd_pcm_format_size(9)
π
snd_pcm_format_size(9) π
okay bestie, welcome to this lil page from the Kernel API Manual β it's short, it's useful, and it's literally about figuring out how many bytes your samples take up. slay. π
β¨ NAME β¨
snd_pcm_format_size β return the byte size of samples on the given format. no cap, that's the whole gig. π
πΈ SYNOPSIS πΈ
ssize_t snd_pcm_format_size (snd_pcm_format_t format , size_t samples );
π¦ ARGUMENTS π¦
formatβ the format to check. yes bestie, the format in question πsamplesβ sampling rate. that's what the page says, so that's what we're telling you π
β RETURN β
The byte size of the given samples for the format, or a negative error code if the format is unknown. so if it's a mystery format, you get a negative error code β not a vibe, but useful π
π SEE ALSO π
Kernel file ./sound/core/pcm_misc.c and all these iconic little functions:
snd_pcm_format_signed(9)snd_pcm_format_unsigned(9)snd_pcm_format_linear(9)snd_pcm_format_little_endian(9)snd_pcm_format_big_endian(9)snd_pcm_format_width(9)snd_pcm_format_physical_width(9)snd_pcm_format_silence_64(9)snd_pcm_format_set_silence(9)snd_pcm_hw_limit_rates(9)snd_pcm_rate_to_rate_bit(9)snd_pcm_rate_bit_to_rate(9)snd_pcm_rate_mask_intersect(9)
mwah π this cutie comes from ./sound/core, dated October 2026, and it's serving Kernel API Manual energy. bye bestie, go check those formats π«Άβ¨
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms