NA_RECORD(1)

✨ NA_RECORD(1) ✨

ok so bestie, welcome to the na_record page from the General Commands Manual πŸ’– this is the one that records waveform from audio device and honestly? iconic.


πŸŽ€ NAME πŸŽ€

na_record β€” record waveform from audio device. that's it, that's the whole job, and she does it slayfully 🫢


πŸ¦‹ SYNOPSIS πŸ¦‹

na_record [-h] [-f sampling rate] [-audiodevice device] [-time seconds]
          [-o file] [-otype type] [-ostype sample type] [-F sample rate]
          [-obo MSB | LSB | native] [-oswap] [-p audio device protocol]

look at all those flags, she's literally dressed for every occasion πŸ’…


πŸ’œ DESCRIPTION πŸ’œ

so what does na_record actually do? she grabs digital audio data from your system's audio input device and writes it straight to the file you picked. that's the main character move. she's also lowkey flexible β€” a whole variety of output file formats? supported. native audio devices? supported. we love a versatile queen πŸ‘‘

here's the option flags she recognizes, no cap:

  • -h β€” prints a short summary of usage to standard output. basically the "hey bestie here's how u use me" flag 🌸
  • -f sampling rate β€” sets the input sampling rate, in samples per second (aka Hz, iykyk). heads up tho: not every device vibes with every sampling rate, so it may be desirable to set this separately from the output sampling rate. they're different things, don't be fooled πŸ™ˆ
  • -audiodevice device β€” sets the audio device to record from, if it's supported by the audio protocol you chose (think stuff like /dev/dsp, /dev/audio) 🎧
  • -time seconds β€” stops recording after the specified number of seconds. a little timer, a little boundary, we stan ⏱️
  • -o file β€” writes sound output to the specified file. yes the file. that one πŸ“
  • -otype type β€” specifies the file format for output. supported types currently include nist, est, dsps, snd, riff, aiff, audlab, raw, and ascii. the -h flag will show the most accurate list (so like, trust -h over this list, fr fr). the default type is nist ✨
  • -F sampling rate β€” sets the output sampling rate (again, in samples per second, i.e. Hz). if this differs from the input sampling rate, resampling will be done β€” she'll do the work for u πŸ’ͺ. defaults to 16000Hz.
  • -obo byte order β€” sets the output byte order. supported values are MSB, LSB, and native. ngl this one isn't tremendously useful except for raw data, bc many file formats have their own byte order or are byte order independent entirely. the default is the native byte order for the system audio device 🧚
  • -oswap β€” swap bytes when saving to output. little endian to big endian glow-up πŸ”„
  • -ostype sample type β€” sets the sample type of the output. supported values are short, mulaw, byte, or ascii. again, this is usually implied by the file format, so it should only be used for raw data. the default is short (i.e. 16-bit PCM) πŸ“
  • -p audio device protocol β€” selects an audio device protocol (i.e. the type of audio device) to use. this varies between different installations of Speech Tools, but it defaults to the most 'native' audio device β€” usually Open Sound System on Linux and *BSD, and /dev/audio on Solaris 🌈

🌸 ENVIRONMENT 🌸

the environment variables, the backstage crew, the ones working behind the scenes:

  • NA_PLAY_PROTOCOL β€” audio protocol to use (same energy as the -p flag) πŸŽ€
  • NA_PLAY_HOST β€” host to record audio from when using a network audio protocol. yes, record from a whole other host, networking era πŸ’»βœ¨

πŸ”₯ EXAMPLES πŸ”₯

ok so here's the tea, two little demos for u:

record five seconds of audio from /dev/dsp1 (on Linux) to foo.wav in RIFF format at 32kHz:

$ na_record -time 5 -audiodevice /dev/dsp1 -o foo.wav -otype RIFF
-f 32000

record one second of audio to bar.wav in raw format in 8kHz mu-law:

$ na_record -time 1 -o bar.wav -otype raw -ostype mulaw -f 8000

periodt. go make some files πŸ’…


πŸ’€ BUGS πŸ’€

the -time argument only accepts integer values β€” even though the usage message implies otherwise 😭 so like, don't come at her with 2.5 seconds, she will simply not. the usage message is lying to u a lil bit, sorry bestie πŸ™ˆ

πŸ‘‘ SEE ALSO πŸ‘‘

  • na_play(1) β€” the other half of the duo, the playback queen 🎢

and that's the page!! mwah πŸ’–

Edinburgh Speech Tools πŸŽ€ April 4, 2001 β€” yeah she's an old icon, a vintage queen, still serving audio since '01 ⭐ πŸ¦‹