bytes_to_frames(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

✨ bytes_to_frames β€” the Kernel API Manual, but make it make sense πŸ’…

okay so bestie, welcome to bytes_to_frames(9) β€” the little kernel helper that does exactly one thing and does it iconically: it converts a size from bytes into frames. that's it. that's the whole vibe. πŸŽ€


🌸 NAME 🌸

bytes_to_frames β€” unit conversion of the size from bytes to frames

like, literally the glow-up of a byte count into a frame count. no cap.


⭐ SYNOPSIS ⭐

snd_pcm_sframes_t bytes_to_frames (struct snd_pcm_runtime *runtime ,
ssize_t size );

two arguments, one return value, zero drama. the way that signature just sits there being all neat and correct 🫢


πŸ’– ARGUMENTS πŸ’–

  • runtime β€” the PCM runtime instance. yes queen, you gotta hand over the whole runtime context, she's part of the equation.
  • size β€” the size in bytes. the raw material. the before picture. πŸ”₯

πŸ‘‘ RETURN πŸ‘‘

it returns the size in frames. periodt. that's the answer to "so how many frames is that" and it is giving convenience πŸ’œ


🌈 SEE ALSO 🌈

the lore continues in the kernel file ./include/sound/pcm.h β€” and here's the whole friend group, no one left out bestie:


ngl if you needed bytes_to_frames you probably also need bytes_to_samples, samples_to_bytes and frames_to_bytes β€” the conversion quartet ate and left no crumbs πŸ”₯

that's the whole page bestie, short and slay. this one lives under ./include/sound, dated October 2026, and it's bytes_to_frames(9) from the Kernel API Manual β€” go forth and convert those bytes into frames πŸ’…βœ¨πŸŒ·

πŸ“¦ where this page comes from