Modifications

Sauter à la navigation Sauter à la recherche
5 186 octets ajoutés ,  15 mars 2012 à 12:20
Page créée avec « {{WaveShield-Nav}} == Getting Stack overflow errors? == These examples are all tested to work with v13 or higher, so try to use that if possible! == Avoir plus de RAM et d... »
{{WaveShield-Nav}}

== Getting Stack overflow errors? ==

These examples are all tested to work with v13 or higher, so try to use that if possible!

== Avoir plus de RAM et de Flash! ==
Note MCHobby:
Les plateformes Arduino sont maintenant distribuée avec un ATmega328.

Cette section n'est vraiment pertinente que si vous ne possédez pas d'ATmega328.

Avant d'essayer de jouer de l'audio, vous aurez besoin de faire un peu de place

la mémoire RAM d'Arduino, cela évitera que cela se termine en vilain

dépassement de pile (stack-overflow). Manquer de mémoire RAM est difficile à déboguer et frustrant, d'autant plus si vous disposez d'un ATMega168

[http://www.ladyada.net/library/arduino/hacks.html Suivez ces instructions] (''anglais'') pour savoir comment avoir plus

de RAM en réduisant la taille de la mémoire tampon de la librairie série (Serial library).

Vous n'aurez pas besoin de faire cela si vous avez un [http://www.ladyada.net/library/arduino/upgrade.html ATmega328].

Notez que la librairie est vraiment grosse (approximativement 10K). Si vous voulez faire beaucoup plus avec Arduino, il est vivement conseillé de faire un Upgrade vers un [http://www.ladyada.net/library/arduino/upgrade.html ATmega328]. Ce shield a été développé en prévoyant la disponibilité d'un ATmega328.

== Generating speech ==

If you want a human voice in your project, you can use the free generator at [http://www.research.att.com/%7Ettsweb/tts/demo.php#top AT&T Text-to-Speech demo page] (sais aussi parler en français :-) )

It will create a 16KHz, 16-bit audio file so you can use the audio 'right out of the box'

== Sound sample library ==

Here is [http://wiki.laptop.org/go/Sound_samples huge collection of C.C. Attribution licensed sound samples]! A lot of it is already mono, 16 or 22KHz

== Digital audio player ==

This is the simplest example. It plays every audio file it finds on the SD card in a loop. This sketch is also included in the library

* [http://www.ladyada.net/media/wavshield/PlayAllLoop.pde Sketch] (for the original AF_Wave library)
* [http://www.ladyada.net/media/wavshield/daphc.pde Sketch] (for the newer [http://code.google.com/p/wavehc/ waveHC library] also check the [http://code.google.com/p/wavehc/ WaveHC library zip for any newer revision])

== 6 buttons, 6 sounds, multiple possibilities! ==

Here is a collection of different playback techniques with 6 buttons (connected to analog 0-5)

You can change the # of buttons and what they're wired to easily. This isn't an exhaustive list but will give you some ideas about how you can do a lot with the [http://code.google.com/p/wavehc/ WaveHC library]. Note that all the changes occur in loop(). The button checking and everything else is the same.
* [http://www.ladyada.net/media/wavshield/wavehc_play6completeonce.pde Play the wave file all the way through, and only once]
* [http://www.ladyada.net/media/wavshield/wavehc_play6completeoneloop.pde Play one wave file all the way through, in a loop]
* [http://www.ladyada.net/media/wavshield/wavehc_play6completeallloop.pde Play all the pressed wave files all the way through, in a loop]
* [http://www.ladyada.net/media/wavshield/wavehc_play6singlekeyonce.pde Play the wave file only when the button is held down and only once] (kind of like a musical keyboard)
* [http://www.ladyada.net/media/wavshield/wavehc_play6singlekeyloop.pde Play the wave file only when the button is held down and loop it] (kind of like a sampler keyboard)
* [http://www.ladyada.net/media/wavshield/wavehc_play6interloop.pde Play the wave file all the way through and loop it, but allow other buttons to interrupt]
* [http://www.ladyada.net/media/wavshield/wavehc_play6interonce.pde Play the wave file all the way through once, but allow other buttons to interrupt]

== Playing sound based on input ==

[http://www.ladyada.net/forums/viewtopic.php?t=6120 This example] plays 6 different files depending on whether buttons connected to the 6 analog input pins are pressed. (for AF_wave)

[http://www.ladyada.net/media/wavshield/wavehc_play6.pde This similar example plays 6 different files] but its for [http://code.google.com/p/wavehc/ WaveHC library] ([[AdaFruit Wave Shield WaveHC_6|theres a walkthrough here]])

[http://www.ladyada.net/media/wavshield/SerialControl.pde This one plays 4 different files depending on serial characters], good if you have say an xbee you want to use

== Changing the playback rate ==

By messing with the playback interrupt, [[http://www.adafruit.com/blog/2008/05/21/wave-shield-bending-the-playback-sample-rate/ you can change the speed of playback for an interesting effect]].

[[http://www.ladyada.net/media/wavshield/SampleRateMod.pde Here is the sketch]], connect the potentiometer to analog pin 0 (or change the code)

== Halloween pumpkin ==

[http://www.ladyada.net/make/pumpkin/pumpkin.html An example of using a sensor to trigger sounds, as well as animating LEDs based on the volume]

== Volume control via software ==

By changing the #define DVOLUME 1 in wave.cpp and recompiling you can do [http://www.ladyada.net/media/wavshield/SoftVolumeChange.pde rudimentary software volume control as in this sketch]
29 918

modifications

Menu de navigation