using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows.Forms;
using NAudio;
using NAudio.WindowsMediaFormat;
using GTA;

namespace tutorialScriptVS
{
    public class tutScriptVS : GTA.Script
    {

        public tutScriptVS()
        {
            //bind phone
            BindPhoneNumber("ROLL 555 2001", new PhoneDialDelegate(callHandle));
        }
        public void callHandle()
        {
            //here we set the initial object that need the path to wav file
            NAudio.Wave.WaveFileReader s = new NAudio.Wave.WaveFileReader(".\\Scripts\\roll.mp3");
            //now we create this wave channel and use previous object as parameter
            NAudio.Wave.WaveChannel32 wc = new NAudio.Wave.WaveChannel32(s);
            //now we create the object that will control the playback
            NAudio.Wave.DirectSoundOut player = new NAudio.Wave.DirectSoundOut();

            //here we initialize the playback object
            player.Init(wc);
            //and here we play
            player.Play();
            Wait(10000);
            player.Stop();
        }

        
    }
}