Guest User

Call For Rick Roll

a guest
Dec 22nd, 2014
264
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.17 KB | None | 0 0
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.Windows.Forms;
  6. using NAudio;
  7. using NAudio.WindowsMediaFormat;
  8. using GTA;
  9.  
  10. namespace tutorialScriptVS
  11. {
  12.     public class tutScriptVS : GTA.Script
  13.     {
  14.  
  15.         public tutScriptVS()
  16.         {
  17.             //bind phone
  18.             BindPhoneNumber("ROLL 555 2001", new PhoneDialDelegate(callHandle));
  19.         }
  20.         public void callHandle()
  21.         {
  22.             //here we set the initial object that need the path to wav file
  23.             NAudio.Wave.WaveFileReader s = new NAudio.Wave.WaveFileReader(".\\Scripts\\roll.mp3");
  24.             //now we create this wave channel and use previous object as parameter
  25.             NAudio.Wave.WaveChannel32 wc = new NAudio.Wave.WaveChannel32(s);
  26.             //now we create the object that will control the playback
  27.             NAudio.Wave.DirectSoundOut player = new NAudio.Wave.DirectSoundOut();
  28.  
  29.             //here we initialize the playback object
  30.             player.Init(wc);
  31.             //and here we play
  32.             player.Play();
  33.             Wait(10000);
  34.             player.Stop();
  35.         }
  36.  
  37.        
  38.     }
  39. }
Advertisement
Add Comment
Please, Sign In to add comment