3 ms·
dunno what they used however the simple of it can be where your code synthesizes the audio curve ... just a time series of floating point numbers ( or integers
by AtomicOrbital 7y ago
dunno what they used however the simple of it can be where your code synthesizes the audio curve ... just a time series of floating point numbers ( or integers ) which is analogous to the wobble of the microphone membrane or your eardrum ... then to render this there are two fundamental notions regarding this raw audio --- bit depth and sample rate --- bit depth drives how granular this curve gets digitized typically you use two bytes ( 16 bit ) to store each point on this audio curve --- sample rate is simply how many of these audio samples you store per second ( CD quality is 44,100 samples per second ) ... this level of raw audio is called PCM ... to render it most easily simply output a 44 byte header which outlines the audio spec followed by the payload which is this PCM audio where each audio sample out putted into the output file is saved across two consecutive bytes, meaning a given audio sample ( a point on the audio curve ) consumes 16 bits of memory which gets saved as two bytes in the output file ... then you have your own WAV file which can get rendered using command line tools like ffplay, aplay, vlc or whatever
- qwerty456127 7y agoThanks. But what I am looking for is to render an array of notes to PCM (or whatever). I've tried defining the notes as frequencies and using a waveform rendering library (in Python) but it's very slow and clicky - a wave of a particular tone gets cut abruptly right before the next one starts and that produces a click. I need something more intelligent to sort of crossfade subsequent tones into each other or so. Perhaps I should just use a filter...
- magicalhippo 7y agoIsn't this a good case for MIDI? For example using something like https://github.com/nwhitehead/pyfluidsynth https://github.com/nwhitehead/pyfluidsynth