SOUNDTOH(1)

πŸ’– SOUNDTOH πŸ’–

okay bestie, gather round, because this is soundtoh, part of the General Commands Manual, and it is lowkey one of the most underrated little glow-up tools in the whole Network Audio System lineup. ✨


🌸 NAME 🌸

soundtoh β€” convert a sound file to a C language header file

like… it takes ur audio and turns it into code. it's giving alchemy. it's giving glow up. πŸ¦‹


✨ SYNOPSIS ✨

soundtoh filename

that's it. one argument. one job. she's focused, she's unbothered, she's an icon. πŸ’…


πŸŽ€ DESCRIPTION πŸŽ€

so here's the tea, bestie: the soundtoh program will convert a sound file in a format supported by the Network Audio System library into a header file suitable for use with the #include C pre-processor directive. yes, THE #include. the one u know and love. 🫢

the resulting output is directed to the standard output, so pipe it wherever ur heart desires. no cap.

the output will look something like:

/* 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,
};

not the /* bark */ comment and the "terrier bark" string like 😭 it's a dog sample. whoever wrote this was having the best day of their life. main character energy fr fr. πŸΆπŸ’€

and okay, important detail, don't skip this part: 16-bit samples will be converted appropriately depending upon the endianess of the host machine. so like, she's reading the room. she's adapting. she's not gonna hand u byte-swapped chaos. endian-aware queen. πŸ‘‘


🌈 SEE ALSO 🌈

  • nas(1) β€” go read her too, she's the whole ecosystem bestie

Copyright 1993, 1994 Network Computing Devices, Inc.


🌟 AUTHOR 🌟

Greg Renda, Network Computing Devices, Inc.


⚠️ okay so real talk, no drama: this page lists no options and no environment variables, so if ur looking for flags to tweak… there aren't any. it's just soundtoh filename. that's the whole vibe check. don't go inventing flags that don't exist, bestie, that's not the move. πŸ™ˆ

and that's the whole page, periodt. this was version 1.9.4 of the SOUNDTOH(1) manual page, dated with that classic 1.9.4 energy β€” love her, stan her, go convert some sounds into headers. πŸŽ€βœ¨πŸ¦‹πŸ’–πŸŒΈ