La bibliothèque se documente elle-même · Son
stzSound
40 méthodes propres · 10 formes avec extensions, rangées sous leur méthode
la source: base/sound/stzSound.ring(s'ouvre dans un nouvel onglet) · Toutes les classes · La référence du domaine : Son
Sous chaque méthode, ses extensions (Q CS XT Z ZZ IB W U) : en gras et cochée, elle existe ; barrée, elle n'existe pas. Les extensions et leur sens
Aucune méthode de cette classe n'est exécutée sur cette page : la classe touche aux fichiers, au réseau, aux processus, à l'horloge, au hasard ou au son, et un exemple exécuté ici ne serait que l'exemple de ses effets. Chaque méthode porte l'explication que la bibliothèque donne d'elle-même.
Méthode
Explication, telle que la source la porte
init
(sans commentaire dans la source : le nom se lit comme une phrase) initaucune extension
MakeSilence
lifecycleQCSXTZZZIBWU
AdoptBuffer
(sans commentaire dans la source : le nom se lit comme une phrase) adopt bufferaucune extension
BufferId
Hand the engine id out -- for a graph that wants this sound as a source. An ENGINE handle, not a pointer, so it obeys the house law.aucune extension
Release
(sans commentaire dans la source : le nom se lit comme une phrase) releaseaucune extension
IsEmpty
(sans commentaire dans la source : le nom se lit comme une phrase) is emptyaucune extension
LastError
(sans commentaire dans la source : le nom se lit comme une phrase) last erroraucune extension
Frames
readers: they return DATA and keep their namesaucune extension
Channels
(sans commentaire dans la source : le nom se lit comme une phrase) channelsaucune extension
SampleRate
(sans commentaire dans la source : le nom se lit comme une phrase) sample rateaucune extension
Duration
(sans commentaire dans la source : le nom se lit comme une phrase) durationaucune extension
Peak
(sans commentaire dans la source : le nom se lit comme une phrase) peakaucune extension
Rms
(sans commentaire dans la source : le nom se lit comme une phrase) rmsaucune extension
SampleAt
ONE sample. 1-based frame and channel, like every Haro face.aucune extension
SetSampleAt
(sans commentaire dans la source : le nom se lit comme une phrase) set sample atQCSXTZZZIBWU
ToList
The samples of one channel, as a Haro list. DATA, so To... is right. Be aware this crosses the FFI once per sample -- fine for a look at a few thousand frames, wrong for a whole song.aucune extension
ResampleTo
verbs that change the sound ---------------------------------------- Resample to a new rate. QUALITY is sinc unless you ask otherwise -- SN1 measured sinc at 97x the accuracy of linear for 26x the cost, and still 150x faster than real time, so it is the right default.QCSXTZZZIBWU
ResampleToFast
(sans commentaire dans la source : le nom se lit comme une phrase) resample to fastQCSXTZZZIBWU
ChangeChannelsTo
(sans commentaire dans la source : le nom se lit comme une phrase) change channels toQCSXTZZZIBWU
ToMono
(sans commentaire dans la source : le nom se lit comme une phrase) to monoQCSXTZZZIBWU
ToStereo
(sans commentaire dans la source : le nom se lit comme une phrase) to stereoQCSXTZZZIBWU
ToWavBytes
The symmetric half of loading from memory, and its absence was a real gap: a sound could be decoded FROM bytes but not encoded back TO them, so handing a buffer to another tier meant a temporary file. VC1 went to some trouble to keep a voice out of the filesystem; without this, VC3 would have put it straight back to feed a recogniser.aucune extension
MixIn
16-bit by default: it is what everything reads, and SN1 measured the round-trip error at 4.18e-5, one quantum. Ask for 32 when you are handing the file back to another stage rather than to a listener. ADD another sound into this one from pnSeconds in, scaled by pnGain -- notes laid on a timeline. Refused when the sample rates differ: a note mixed at the wrong rate would be a different pitch, silently.aucune extension
SaveAs
(sans commentaire dans la source : le nom se lit comme une phrase) save asQCSXTZZZIBWU
SaveAsFloat
(sans commentaire dans la source : le nom se lit comme une phrase) save as floatQCSXTZZZIBWU
Play
hearing it ---------------------------------------------------------- PLAY IT, and wait for it to finish. There is no sample-player in the engine -- the device sink plays a STREAM -- so the face builds the smallest graph that can carry this sound and runs it. That is what a declarative face is for: the caller says "play", not "make a graph, start a producer thread, open a device, wait, then take it all down".aucune extension
PlayFor
(sans commentaire dans la source : le nom se lit comme une phrase) play forQCSXTZZZIBWU
ToSpectrum
To...() because these RETURN things. A spectrum is a stzSoundGrid: rows by columns of numbers, with x_step and y_step saying what a row and a column MEAN. Drawing one is the graphics plane's job, and keeping that boundary is what makes the analysis assertable -- "the 1 kHz sine is in the 1 kHz bin" is a claim about numbers; "the picture looks right" is a claim about nothing. The magnitude spectrum of one window. Default 4096 points: about 12 Hz resolution at 48 kHz, which resolves musical pitch without smearing time.aucune extension
ToSpectrumOf
(sans commentaire dans la source : le nom se lit comme une phrase) to spectrum ofaucune extension
ToSpectrogram
Frequency against time: one row per window. MULTICORE by default -- every row is an independent FFT over a different slice of the same immutable buffer, which is the one analysis here that parallelises without an argument.aucune extension
ToSpectrogramOf
(sans commentaire dans la source : le nom se lit comme une phrase) to spectrogram ofaucune extension
DominantFrequency
The strongest frequency present, in hertz.aucune extension
ToOnsets
Where notes START, in seconds -- a one-row grid of times.aucune extension
ToOnsetsOf
(sans commentaire dans la source : le nom se lit comme une phrase) to onsets ofaucune extension
Tempo
Beats per minute, or -1 when there are too few onsets to say -- which is a better answer than a confident number derived from two events.aucune extension
Loudness
The standard's K-weighting coefficients are specified at 48 kHz, and the engine REFUSES any other rate rather than applying them anyway. So the face resamples a COPY when it has to -- the caller's sound is not touched, and nobody gets a plausible-looking wrong number.aucune extension
MomentaryLoudness
MomentaryLoudness is the standard's own 400 ms window, ungated, taking the LOUDEST such window rather than a mean -- averaging an earcon against the silence around it answers nothing. BS.1770 arithmetic used as specified, so it is LUFS without qualification.aucune extension
ShortTermLoudness
(sans commentaire dans la source : le nom se lit comme une phrase) short term loudnessaucune extension
LoudnessOfSupport
The same K-weighting and the same formula over the sound's OWN length. NOT a standard LUFS figure, and LoudnessMetric() says so -- because the alternative is answering the standard's question wrongly instead of answering a different question honestly. A 60 ms earcon at peak 0.5 reads -9.26 here against -9.27 for the same tone at 400 ms: the two agree to a hundredth of a decibel where the standard has an opinion, which is what makes this trustworthy where it does not.aucune extension
LoudnessMetric
What the number means, so it never travels without its method.aucune extension

