Pages

Tuesday, November 26, 2013

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

Hohoho, that's good, thx to my pal TheVideoVolcano and to NAudio developers now i can play simultaneous sounds in my scripts, and you as well :)

What we need to have is this gorgeous DLL: NAudio

The code it really is extremely easy:


We want 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:

Manage Volume:

original volume is 1., we can decrease or enhance it:
wc.Volume = .1
Wait(500)
wc.Volume = 2
Wait(500)
wc.Volume = 1
Skip seconds of audio:
wc2.Skip(1)
Seek to establish playback commence in audio information
wc2.Seek(100000, SeekOrigin.Commence)

Download the sample project right here, don't forget to put NAudio.dll inside gtaiv.exe folder, or you will acquire error when calling the methods :)
[TUT] Using NAudio to play sounds - Very good, play more than one sound at same time :)
9out of 10 based on 10 ratings. 9 user reviews.

No comments:

Post a Comment

Note: Only a member of this blog may post a comment.