I solved it with a transistor since I didn't seem to be able to solve it with code.
I write:
void updateControl(){
static int previous;
int current = digitalRead(STOP_PIN);
if(previous==HIGH && current==LOW){
digitalWrite(activatePin, HIGH);
start();
}else if(previous==LOW && current==HIGH){
digitalWrite(activatePin, LOW);
}
previous=current;
}
With this code, the sample will loop when power is applied, but since pin 9 is wired to the collector on an npn-transistor with it's emitter wired to the audio amplification stage, there's going to be no sound from the speaker as long as the transistor is off. When pin 7 goes LOW, pin 8 which is wired to the base of the transistor goes HIGH, thus turning the transistor on which will send the sound signal to the amplification stage. At the same time, the sample starts from the beginning on each button press using start();
This will behave the same way as if I was doing start stop in code, but since I couldn't figure out how to do it, if even possible, I came up with this idea instead.
Thank you for all help, you helped me to reach this solution.