begin process at 2010 03 21 11:31:05
  Trouver un code source :
 
dans
 
Accueil > 

Code

 > 

Divers

 > $WAV

$WAV


 Information sur la source

Note :
9,5 / 10 - par 4 personnes
9,50 / 10

  • 1

  • 2

  • 3

  • 4

  • 5

  • 6

  • 7

  • 8

  • 9

  • 10
Catégorie :Divers Niveau :Expert Date de création :20/02/2005 Vu :2 769

Auteur : Hades53

Ecrire un message privé
Commentaire sur cette source (6)
Ajouter un commentaire et/ou une note

 Description

Retourne les informations d'un fichier audio wav.

Source

  • ;usage: $wav(fichier).channels|format|frequency|bps|bpsample|length
  • alias wav {
  • var %size = $file($1-).size
  • if (!%size) return 0
  • bread " $+ $1- $+ " 0 2048 &wav
  • ;Un fichier WAV qui se respecte, commence toujours par RIFF
  • if ($bvar(&wav,1,4).text != RIFF) return
  • ;chunck format
  • var %pos = $bfind(&wav,5,fmt)
  • if (!%pos) return
  • ;chunck data
  • var %pos2 = $bfind(&wav,%pos,data)
  • ;on 'enlève' la taille des headers
  • dec %size $calc(%pos2 + 8 + $bvar(&wav,%pos2,$calc(%pos2 + 4)).long)
  • if ($prop == channels) return $bvar(&wav,$calc(%pos + 10)).word
  • if ($prop == format) {
  • var %name = G723_ADPCM ANTEX_ADPCME G721_ADPCM APTX AUDIOFILE_AF36 AUDIOFILE_AF10 CONTROL_RES_VQLPC CONTROL_RES_CR10 CREATIVE_ADPCM DOLBY_AC2 DSPGROUP_TRUESPEECH DIGISTD DIGIFIX DIGIREAL DIGIADPCM ECHOSC1 FM_TOWNS_SND IBM_CVSD OLIGSM OLIADPCM OLICELP OLISBC OLIOPR IMA_ADPCM DVI_ADPCM UNKNOWN PCM ADPCM ALAW MULAW GSM610 MPEG NMS_VBXADPCM OKI_ADPCM SIERRA_ADPCM SONARC MEDIASPACE_ADPCM YAMAHA_ADPCM
  • var %num = 20 51 64 37 36 38 52 55 512 48 34 21 22 53 54 35 768 5 4096 4097 4098 4099 4100 17 0 1 2 6 7 49 80 56 16 19 33 18 32
  • return $gettok(%name,$findtok(%num,$bvar(&wav,$calc(%pos + 8)).word,32),32)
  • }
  • if ($prop == frequency) return $bvar(&wav,$calc(%pos + 12)).long
  • if ($prop == bps) return $bvar(&wav,$calc(%pos + 16)).long
  • if ($prop == bpsample) return $bvar(&wav,$calc(%pos + 22)).word
  • ;taille divisée par le taux bits par seconde
  • if ($prop == length) return $int($calc(%size / $bvar(&wav,$calc(%pos + 16)).long))
  • return $1-
  • }
;usage: $wav(fichier).channels|format|frequency|bps|bpsample|length
alias wav {
  var %size = $file($1-).size
  if (!%size) return 0
  bread  " $+ $1- $+ " 0 2048 &wav
  ;Un fichier WAV qui se respecte, commence toujours par RIFF
  if ($bvar(&wav,1,4).text != RIFF) return
  ;chunck format
  var %pos = $bfind(&wav,5,fmt)
  if (!%pos) return
  ;chunck data
  var %pos2 = $bfind(&wav,%pos,data)
  ;on 'enlève' la taille des headers
  dec %size $calc(%pos2 + 8 + $bvar(&wav,%pos2,$calc(%pos2 + 4)).long)
  if ($prop == channels)  return $bvar(&wav,$calc(%pos + 10)).word
  if ($prop == format) {
    var %name = G723_ADPCM ANTEX_ADPCME G721_ADPCM APTX AUDIOFILE_AF36 AUDIOFILE_AF10 CONTROL_RES_VQLPC CONTROL_RES_CR10 CREATIVE_ADPCM DOLBY_AC2 DSPGROUP_TRUESPEECH DIGISTD DIGIFIX DIGIREAL DIGIADPCM ECHOSC1 FM_TOWNS_SND IBM_CVSD OLIGSM OLIADPCM OLICELP OLISBC OLIOPR IMA_ADPCM DVI_ADPCM UNKNOWN PCM ADPCM ALAW MULAW GSM610 MPEG NMS_VBXADPCM OKI_ADPCM SIERRA_ADPCM SONARC MEDIASPACE_ADPCM YAMAHA_ADPCM
    var %num = 20 51 64 37 36 38 52 55 512 48 34 21 22 53 54 35 768 5 4096 4097 4098 4099 4100 17 0 1 2 6 7 49 80 56 16 19 33 18 32
    return $gettok(%name,$findtok(%num,$bvar(&wav,$calc(%pos + 8)).word,32),32)
  }
  if ($prop == frequency) return $bvar(&wav,$calc(%pos + 12)).long
  if ($prop == bps) return $bvar(&wav,$calc(%pos + 16)).long
  if ($prop == bpsample) return $bvar(&wav,$calc(%pos + 22)).word
  ;taille divisée par le taux bits par seconde
  if ($prop == length) return $int($calc(%size / $bvar(&wav,$calc(%pos + 16)).long))
  return $1-
}



 Sources du même auteur

Source avec une capture GÉNÉRATEUR D'AIDE CONTEXTUELLE
VDOWNLOAD - MULTIPLE TÉLÉCHARGEUR DE FICHIERS
$ID3V1 /ID3V1 $ID3V2
$WMA
$PGCD,$PPCM,$PREMIER

 Sources de la même categorie

AVOIR UNE LISTE D'UTILISATEUR EN COULEURS SELON LEURS SEXE P... par WorldDMT
COMMANDES FANTAISIES ( OP DEOP , VOICE DEVOICE ) ORIGINALES par Orona
Source avec Zip Source avec une capture CORRECTEUR par Orona
Source avec Zip Source avec une capture [DLL] DESSINER COMME LES PICWINS SUR UNE DIALOGBOX (BONUS: J... par uaip
Source avec Zip Source avec une capture [DLL] AJOUT D'UN CONTRÔLE RICHEDIT SCINTILLA SUR LES DIALOG... par uaip

Commentaires et avis

Commentaire de KiNdErMaXi le 20/02/2005 17:42:46

ceci complète $wma
c'est commenté et tout
parfait :)

Commentaire de tidds le 21/02/2005 09:18:23

Bravo ! :)

Commentaire de GiUsTiNo le 21/02/2005 20:41:54

Dans le niveau initié, ca aurait pas été mieux ? Quoique ...
Bien vu quand même, cela prouve encore que le domaine du mIRC est assez vaste :)
Pas mal programmé, code commenté, 9/10 :)
Continue comme ca !

Giustino, Admin VegaGames

Commentaire de Hades53 le 22/02/2005 00:02:13

Je sais pas, j'ai hésité entre les deux, et je l'ai mis dans le niveau où il y a le moins de codes, à savoir: expert.

Si ça gène du monde, je pourrais le mettre au niveau Initié.

Commentaire de KiNdErMaXi le 22/02/2005 16:05:22

non c'est très bien comme ca. D'ailleurs je vois pas beaucoup d'addons utilisant l'identifieur $prop en tout cas j'ai appris a m'en servir :p
et puis j'ai vu aussi $ogg sur sdb
$wma $ogg et $wav que demande le peuple :D

Commentaire de DiSRupTOr le 14/08/2005 02:23:50

Très bon code, bravo ;)

 Ajouter un commentaire




Nos sponsors


Sondage...

CalendriCode

Mars 2010
LMMJVSD
1234567
891011121314
15161718192021
22232425262728
293031    

Consulter la suite du CalendriCode

Photothèque

 
Développement réalisé par Nicolas SOREL (Nix) avec l'aide de : Cyril DURAND et Emmanuel (EBArtSoft), Merci à Vincent pour ses précieux conseils.
CodeS-SourceS.com© Toute reproduction même partielle est interdite sauf accord écrit du Webmaster
CodeS-SourceS.com© est une marque déposée tous droits réservés

Google Coop CodeS-SourceS Google Coop CodeS-SourceS
Temps d'éxécution de la page : 0,842 sec (3)

Nous contacter | Annoncer sur CodeS-SourceS | Mentions légales