filesr — Retourne le taux d'échantillonnage d'un fichier son.
ifilcod -- fichier son à interroger
iallowraw -- (facultatif) permet des fichiers son bruts (vaut 1 par défaut)
filesr retourne le taux d'échantillonnage du fichier son ifilcod. filesr peut retournet le taux d'échantillonnage des fichiers de type convolve et PVOC si le paramètre iallowraw est différent de zéro (il est non nul par défaut).
Voici un exemple de l'opcode filesr. Il utilise les fichiers filesr.csd et mary.wav.
Exemple 203. Exemple de l'opcode filenchnls.
Voir les sections Audio en Temps Réel et Options de la Ligne de Commande pour plus d'information sur l'utilisation des options de la ligne de commande.
<CsoundSynthesizer> <CsOptions> ; Select audio/midi flags here according to platform ; Audio out Audio in -odac -iadc ;;;RT audio I/O ; For Non-realtime ouput leave only the line below: ; -o filesr.wav -W ;;; for file output any platform </CsOptions> <CsInstruments> ; Initialize the global variables. sr = 44100 kr = 4410 ksmps = 10 nchnls = 1 ; Instrument #1. instr 1 ; Print out the sampling rate of the ; audio file "mary.wav". isr filesr "mary.wav" print isr endin </CsInstruments> <CsScore> ; Play Instrument #1 for 1 second. i 1 0 1 e </CsScore> </CsoundSynthesizer>
Le fichier audio « mary.wav » a été échantillonné à 44.1 KHz. Ainsi
la sortie de filesr contiendra une ligne comme :
instr 1: isr = 44100.000