SOUNDTOH(1)
π SOUNDTOH π
okay bestie, gather round, because this one is genuinely so fun β it's soundtoh, a little utility from the General Commands Manual crowd, and it does exactly one thing but it does it beautifully. β¨
πΈ NAME πΈ
soundtoh β convert a sound file to a C language header file π
β¨ SYNOPSIS β¨
soundtoh filename
that's it. one argument. no notes. π
π¦ DESCRIPTION π¦
okay so here's the vibe: soundtoh takes a sound file in a format that the Network Audio System library supports and turns it into a header file β yes, like an actual C header, the kind you pull in with the #include pre-processor directive. so you can literally hardcode a bark into your program. iconic behavior, no cap. πΆ
the resulting output goes straight to standard output. like, it just prints the whole header at you. and the output looks something like this:
/* bark */
#define barkDataFormat AuFormatULAW8
#define barkSampleRate 8000
#define barkNumTracks 1
#define barkNumSamples \
(sizeof(barkSamples) / sizeof(barkSamples[0]) / barkNumTracks)
static char *barkComment = "terrier bark";
static unsigned char barkSamples[] =
{
0x57, 0x52, 0x51, 0x55, 0x5d, 0x72, 0xe5, 0xdc,
0xdc, 0xe2, 0xed, 0x76, 0x61, 0x5b, 0x59, 0x5e,
.
.
.
0x66, 0xf0, 0xde, 0xe0, 0xf1, 0x6d, 0x67, 0x6a,
0x77, 0xee, 0xe5, 0xe6, 0xf1, 0x71, 0x6b,
};
look at that. the comment, the defines, the whole sample array β chef's kiss. π§π³π
and a lil heads up, bestie: 16-bit samples will be converted appropriately depending upon the endianess of the host machine. so like, the bytes get arranged the way your machine wants them. it's giving considerate. π«Ά
π SEE ALSO π
go read that one next, iykyk. π
π COPYRIGHT π
Copyright 1993, 1994 Network Computing Devices, Inc.
β AUTHOR β
Greg Renda, Network Computing Devices, Inc.
and that's the whole page, bestie!! this lil masterpiece is version 1.9.5, and honestly? it ate. go convert a sound file. slay. πβ¨ππ¦
π¦ where this page comes from
- fedora 43: nas 1.9.5-11.fc41 Β· MIT
- fedora 43: nas 1.9.5-14.fc43 Β· MIT
- fedora 44: nas 1.9.5-15.fc44 Β· MIT
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms