Modifications

Sauter à la navigation Sauter à la recherche
Ligne 117 : Ligne 117 :  
</nowiki>
 
</nowiki>
   −
== Playing the file ==
+
== Jouer un fichier ==
   −
Finally we can play the file! Its quite easy, once the wavefile has been opened as above, simply call '''wave.play()''' to being playback. The Arduino plays audio in an interrupt, which means that '''wave.play()''' returns immediately. You can then mess with sensors, print feedback or buttons or whatever.
+
Finalement, nous pouvons jouer le fichier! C'est vraiment simple une fois que le fichier wave a été ouvert comme ci-dessus. Il suffit d'appeler '''wave.play()''' pour commencer à jouer le morceau. Arduino jour le morceau en utilisant une interruption, ce qui signifie que '''wave.play()''' s'exécute immédiatement (et ne reste pas bloquée jusqu'à la fin du morceau). Vous pouvez donc utiliser des senseurs ou des boutons ou afficher un retour d'information ou détecter ou tout ce que vous voulez.
   −
While the wavefile is playing, you can check its status with the variable '''wave.isplaying''' . If the variable is 1 then the audio is playing. If its 0 that means it has finished playing
+
Pendant que le fichier wave est joué, vous pouvez vérifier l'état de la variable '''wave.isplaying''' . La variable contient 1 pendant que le fichier Audio est joué, sinon elle contient 0 lorsque le fichier audio est terminé.
   −
You can stop playback by calling '''wave.stop()'''
+
Vous pouvez interrompre le fichier audio en appelant '''wave.stop()'''
    
== Closing the file ==
 
== Closing the file ==
29 917

modifications

Menu de navigation