I am trying to use my piezo speaker as an sensor, that could detect vibrations. In the tutorials that I have followed they recommend to wire a 1 mega ohm resistor parallel to the speaker. Since I do not have resistors of such high resistance, I am wondering if there is something else that I can try and how important is it that there is exactly a 1 M ohm resistor.
You need a "pull down" resistor to keep the input from "floating" to an undefined voltage/state. (The piezo doesn't provide a DC path.) You'll get "readings" without a resistor but you won't get reliable readings.
A lower-value resistor will reduce the signal level. We have no idea how much signal your piezo is putting-out, but you can try a lower value resistor. (You won't damage anything with a lower-value resistor.)
Since I do not have resistors of such high resistance,
Resistors are [u]a few cents each[/u] but if you don't have a local electronics store you'll have to put together a minimum order and/or pay for shipping. You might want to buy a resistor assortment and/or some other miscellaneous components.
You may try to switch input, where your sensor is connected (analog input, probably?) to output mode using pinMode just right after the event has been detected. Than keep pin a few milliseconds as output, to discharge an energy, and switch back to analog using analogRead