Zeyu Feng 201377605

Dependencies:   mbed

On Minerva

Interface/Sound.cpp

Committer:
el19zf
Date:
2020-05-22
Revision:
22:cded0cd8e1c9
Parent:
16:cf2bfada3adf

File content as of revision 22:cded0cd8e1c9:

#include "Sound.h"

Sound::Sound()
{
    
}

Sound::~Sound()
{
    
}

void Sound::menu_sound(Gamepad &pad)
{
    pad.play_melody(5,sound_data_menu,sound_dur_menu,180,0);
}

void Sound::begin_sound(Gamepad &pad)
{
    //count down, each duration 0.5s and 60 beats per minute(1s)
    pad.play_melody(3,sound_data_begin,sound_dur_begin,60,0);
}

void Sound::over_sound(Gamepad &pad)
{
    pad.play_melody(5,sound_data_over,sound_dur_over,60,0);
}

void Sound::vict_sound(Gamepad &pad)
{
    pad.play_melody(5,sound_data_vict,sound_dur_vict,60,0);
}

void Sound::count_sound(Gamepad &pad)
{
    pad.play_melody(3,sound_data_begin,sound_dur_begin,60,0);
}