Sunday, 12 May 2013

[TUT] Using NAudio to play sounds - Very good, play more than one sound at same time :)

Hohoho, that's nice, thx to my friend TheVideoVolcano and to NAudio developers now i can play simultaneous sounds in my scripts, and you too :)

What we need is this beautiful DLL: NAudio

The code it's very simple:


We need to add Naudio.dll as reference in the project and paste one copy of this file in the GTAIV.exe folder

Other interesting features is:

Control Volume:

original volume is 1.0, we can reduce or increase it:
wc.Volume = 0.1
Wait(500)
wc.Volume = 2
Wait(500)
wc.Volume = 1
Skip seconds of audio:
wc2.Skip(1)
Seek to determine playback start in audio data
wc2.Seek(100000, SeekOrigin.Begin)

Download the sample project here, remember to put NAudio.dll inside gtaiv.exe folder, or you will obtain error when calling the methods :)

Related Posts:

  • GTA3 Rage Classic - Junkyard car smasherToday i was kidding with GTA III Rage Classic and decided to create an junkyard car smash feature:Download:GTA 4 Mods (mirror1, mirror2)Controls:Numpad 4, 6 - rotate craneNumpad 8, 5 - change crane pitchNumpad … Read More
  • [Update] Heli Combat v1.2Download: GTA 4 Mods (GTA Garage, MOD Db)News for Heli Combat script:Added customizable hotkeys, now you can set the keys for:Shoot - hkShoot=LButtonSwitch actual gun - hkSwitchGun=QSwitch camera - hkSwitchCam=XShoo… Read More
  • [Script] Iron Man IV - Release post and installation guide :)This mod allows you to have some Iron Man features like repulsor beam, cannon and flight :)Download and installation guide:http://gtaxscripting.blogspot.com/2013/05/iron-man-iv-installation-guide-based-on.htmlNew armors:http:… Read More
  • [Update] AC-130 v1.1This is the new version of my AC-130 script, not big changes, i don't know what more i can do for this scriptWhat i did:Performance improvement using new methods to find targets and create the night vision effectAdded XBox 36… Read More
  • [TUT] Cool "3D" target HUDToday i wanna show how you can use some game features to create an cool "3D" target HUD to use in your scripts, this is an preview of what I'm talking about:Download the sample script here.The idea consists in draw checkpoint… Read More

0 comments:

Post a Comment