WorldViz User Forum  

Go Back   WorldViz User Forum > Vizard

Reply
 
Thread Tools Rate Thread Display Modes
  #1  
Old 02-02-2016, 10:35 AM
jelly jelly is offline
Member
 
Join Date: Feb 2016
Posts: 38
Thank you!

Hi Erikvdb!

First of all thank you so much for the prompt and detailed help! It really helps me understand what is happening in the code. Before I saw your reply, I eventually had managed to do this, it sort of seemed to work:

import viz
import viztask
import random

viz.go()

sound = viz.addAudio('pip.wav')

def soundloop():
for x in range (10):
yield viztask.waitTime(random.randrange(3,7,1))
pip.play()
soundtask = viztask.schedule(soundloop())

But I can understand how your code if different and better and I will play around with it a bit to see what happens if I change various bits of it.

Again, thank you so very much!
Reply With Quote
  #2  
Old 02-04-2016, 03:39 AM
Erikvdb Erikvdb is offline
Member
 
Join Date: May 2013
Posts: 63
No problem!
Yea it's up to you whether you want the sound to start directly after calling the function or not and if the wait has to been exactly between the end of the previous sound and the start of the next. I assume your sound is literally just a pip, so it won't matter so much, but I've ran into problems with this before, wondering why my sounds wouldn't play in quick succession and wishing someone had told me beforehand
Reply With Quote
Reply

Tags
sound loop

Thread Tools
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
preEuler not working? or how to teleport subject multiple times ichitaka Precision Position Tracker (PPT) 1 12-19-2015 03:27 AM
output to multiple (two) sound devices GiudiceLab Vizard 1 08-05-2009 01:12 PM
Multiple Sound Devices GiudiceLab Vizard 2 06-06-2009 10:29 AM
how can I detect when a sound finished playing? bernie Vizard 3 05-10-2007 06:08 PM
Error when playing wav files...? vjonshih Vizard 1 05-23-2005 12:21 PM


All times are GMT -7. The time now is 03:37 PM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
Copyright 2002-2023 WorldViz LLC