FAQFAQ    Board RulesBoard Rules    SearchSearch    LotteryLottery    RouletteRoulette    UsergroupsUsergroups
     RegisterRegister  ProfileProfile    Log in to check your private messagesLog in to check your private messages    Shop    Log inLog in 
View posts since last visit View your posts View unanswered posts

Sound loop

 
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Ask a Modder - Modding
View previous topic :: View next topic  
Author Message
street

New Member
New Member


Joined: 12 Mar 2015
Posts: 5

12 Bank Notes
Items

PostPosted: Wed Apr 19, 2017 8:30 pm    Post subject: Sound loop Reply with quote

Hi guys,

anyone knows how to stop looping sound? If I put the sound in game it plays endless loop.

Thank you!
Back to top
View user's profile Send private message
T3mas1

Junior Member
Junior Member


Joined: 11 Jul 2015
Posts: 84
Location: Czech Republic
189 Bank Notes
Items

PostPosted: Thu Apr 20, 2017 10:21 am    Post subject: Sound loop Reply with quote

I deal with it this way.


stream_create zz, "sounds\music\tatada.ogg"
stream_play zz

wait xxxx

stream_destroy zz → that ends it

zz = the variable

or you can use this script which I haven't tested though.

playsound "ssss", ww, xx, yy, zz

ssss = name of the wave file
ww = the ID of the frame that is the source of the sound I guess
xx = the radius of the sound
yy = the volume (0-1)
zz = The variable that is needed to stop the sound

playsoundstop zz → to stop it
Back to top
View user's profile Send private message
street

New Member
New Member


Joined: 12 Mar 2015
Posts: 5

12 Bank Notes
Items

PostPosted: Thu Apr 20, 2017 11:33 pm    Post subject: Sound loop Reply with quote

When I add the sound, it starts playing automatically and in the mafia I have found this code to play it randomly, thats what I am looking for.

Code:
dim_flt 2
dim_frm 1
FindFrame 0

label 10
  rnd 0, 17                 
  let flt[0] = flt[0] * 1800 
  let flt[0] = flt[0] + 2000
  wait flt[0]
  frm_seton 0, 1
goto 10
end


This random play script works fine, but that sound is still making loop. Need to play it once and stop. There must be some other settings for sound object when importing. I will give it a try. Thank you for reply!
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Mafiascene.com Forum Index -> Ask a Modder - Modding All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group

Generation Time: 0.030 | Queries: 19