Sound(3)
β¨ Sound(3) β¨
okay bestie, so this is Sound(3) from the Library Functions Manual β aka the glow-up guide to describing an audio file π it's giving "struct that knows everything about your sound file" and honestly? iconic.
πΈ Name πΈ
Sound β audio file description. that's it, that's the vibe π
π¦ Structures π¦
first things first, you gotta pull in the headers, no cap:
#include <audio/audiolib.h>
#include <audio/sound.h>
and then boom, the struct itself:
typedef struct
{
. . .
}SoundRec, *Sound;
so SoundRec is the actual struct, and Sound is a pointer to one. yes it's a typedef, yes it's cute, moving on π
π Members π
β οΈ Do not dereference the members of the SoundRec structure directly. Instead use the access macros.
like, literally do not. the macros are RIGHT THERE. they're the main characters. use them π«Ά
throughout all of these, sound is a Sound, aka a pointer to a SoundRec structure. got it? good.
SoundFileFormat(sound)β gets you theintvalue that tells you the format of the sound file.SoundFileFormatString(sound)β gets you the string description of that same file format. words instead of numbers, slay.SoundDataFormat(sound)β gets you theintvalue for the data format of the sound file.SoundDataFormatString(sound)β gets you the string description of the data format. yes, again, the string version. consistency queen.SoundNumTracks(sound)β gets you theintvalue for how many tracks are chillin' in the audio data of the sound file.SoundSampleRate(sound)β gets you theintvalue for the sample rate of the audio data in the sound file.SoundNumSamples(sound)β gets you theintvalue for the total number of samples. all of them. every last one.SoundComment(sound)β gets you the string comment. the lil note. the annotation. πSoundBytesPerSample(sound)β returns the bytes per sample of audio data.SoundNumBytes(sound)β returns the total number of bytes of audio data in the sound file. the whole thing.SoundValidateDataFormat(sound)β returns true if the sound file format is a valid format. it's the vibe check, basically β
π Description π
The SoundRec structure describes an audio file. periodt. that's the whole job description and it does it beautifully β¨
π See Also π
go read these next, bestie, they're the whole friend group:
SoundCloseFileSoundCreateSoundFlushFileSoundOpenFileForReadingSoundOpenFileWritingSoundReadFileSoundRewindFileSoundSeekFileSoundTellFileSoundWriteFile
and also:
audiolibβ Network Audio System C Language Interface π
and that's the whole page, babe π this was sound, version 1.9.5, from the Sound(3) manual. go forth and describe your audio files. i'm obsessed with you. mwah π«Άβ¨
π¦ where this page comes from
- fedora 43: nas-devel 1.9.5-11.fc41 Β· MIT
- fedora 43: nas-devel 1.9.5-11.fc41 Β· MIT
- fedora 43: nas-devel 1.9.5-14.fc43 Β· MIT
- fedora 43: nas-devel 1.9.5-14.fc43 Β· MIT
- fedora 44: nas-devel 1.9.5-15.fc44 Β· MIT
- fedora 44: nas-devel 1.9.5-15.fc44 Β· MIT
- copyright 1994 Steven King
- Copyright 1993 Network Computing Devices, Inc
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms