SoundCreate(3)
β¨ SoundCreate β create a description of an audio file β¨
okay bestie, we're in section 3 of the Library Functions Manual today, and the star of the show is SoundCreate. it's giving audio-library-core π let's get into it.
πΈ Name
SoundCreate β create a description of an audio file.
like, it doesn't make the file, it doesn't play the file, it just describes it. it's the vibe board for your audio, fr fr.
π Synopsis
#include <audio/audiolib.h>
Sound SoundCreate(file_format, data_format, num_tracks, sample_rate,
num_samples, comment)
int file_format;
int data_format;
int num_tracks;
int sample_rate;
int num_samples;
char *comment;
look at all those parameters. she's high maintenance but she's worth it π
π¦ Arguments
file_formatβ the format of the audio file. rn the supported glow-ups are:SoundFileFormatSnd,SoundFileFormatVoc,SoundFileFormatWave,SoundFileFormatAiff, andSoundFileFormatSvx. that's the whole list, no secret extra options hiding in the back π«Άdata_formatβ the format of the actual audio data (different from the file format, bestie, don't mix them up π). the ones currently defined are:AuFormatULAW8,AuFormatLinearUnsigned8,AuFormatLinearSigned8,AuFormatLinearSigned16MSB,AuFormatLinearUnsigned16MSB,AuFormatSignedLinear16LSB, andAuFormatLinearUnsigned16LSB. yes that's seven. yes you have to pick one. slay.num_tracksβ how many tracks are in the audio data. β¨sample_rateβ the sample rate of the audio data. the hertz of it all πnum_samplesβ how many samples are in the audio data. the actual count. the receipts.commentβ (...the original page genuinely says nothing here. iconic of it, honestly. not me adding details that aren't there π)
π Description
SoundCreate creates a SoundRec structure, initializes it with all the values you just handed over, and returns a Sound β which is literally a pointer to that SoundRec structure π«Ά
and if something went wrong? it returns NULL. no SoundRec, no vibes, just NULL. so check your return value, bestie, that's the whole plot π
π See Also
SoundCloseFileSoundOpenFileForReadingSoundOpenFileWriting
and also:
audiolibβ Network Audio System C Language Interface
heads up: keep every one of those related calls on your radar, because a Sound you created is gonna need closing and opening eventually. main character energy requires follow-through π
k that's the whole page!! this was version 1.9.4, and yeah, that's the version + date energy I'm signing off with β go make some audio descriptions, you absolute icon, periodt πβ¨ππ¦πΈ
π¦ where this page comes from
- debian bookworm: libaudio-dev 1.9.4-7
- debian trixie: libaudio-dev 1.9.4-9
- ubuntu jammy: libaudio-dev 1.9.4-7build1
- ubuntu noble: libaudio-dev 1.9.4-8
- ubuntu questing: libaudio-dev 1.9.4-9
- ubuntu resolute: libaudio-dev 1.9.4-9.2
- ubuntu stonking: libaudio-dev 1.9.4-9.2
- 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