| Reply | « Previous Thread | Next Thread » |
|
hi i'm trying to make an app. like nshaver.
it will fade between two sound by the accelerometer data. while rotating phone down it will fade another sound and it will play it and then when rotate phone to up it will fade to other sound. i tried to make it with set_volume() function but it's not worked there is my code: Code:
v=0
def read_xyz(x,y,z):
global v
if(y <= -10):
v=v+2
if(y >= 30):
v=v-30
set_volume(v)
axyz.connect(read_xyz)
if i can control the volume with accelerometer then i can make a fade effect between to sound please help me sorry for my english |
| McLightning34 |
| View Public Profile |
| Find all posts by McLightning34 |
|
You need to apply that to an object.
Suppose, Code:
s=audio.Sound.open("C:\\s.mp3")
s.set_volume(v)
Best Regards, Croozeus |
|
thanks for the helping about set_volume function it's working now
but i wanna ask something more about python syntax it's not enough significant to write a new topic. is there anything in python programming like "wait(1)" to add into the loopings.i was using acknex (3dgamestudio) game engine to make 3d games.and there was something to make timing in while function it was like this: Code:
while(1)
{
.........
wait(1);
}
but there is nothing something like wait() in python.isn't making apps. slow? sorry for my english |
| McLightning34 |
| View Public Profile |
| Find all posts by McLightning34 |
|
Join Date: Feb 2008
Posts: 2,542
Location: Bhavnagar, Gujarat, India
gaba88
Offline
Forum Nokia Champion
|
|
hi
i am not sure but i think this article on timers will help you a bit. EDIT: Have a look at the e32 module there are functions like ao_sleep which can help you more. Enjoy Pythoning Gaba88 Gargi Das- http://gargidas.blogsot.com Forum Nokia Python Wiki Learn Python at http://mobapps.org/PyS60 |
|
Quote:
Code:
import e32
while True:
e32.ao_sleep(5)
print "Hello"
Hope that helps, Best Regards, Croozeus |
|
Quote:
Quote:
|
| McLightning34 |
| View Public Profile |
| Find all posts by McLightning34 |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Problem with Sound class getState() | creepymo | Mobile Java Media (Graphics & Sounds) | 1 | 2005-06-20 19:43 |
| MIDI Sound problem (J2ME / Series 60) | JPapke | Mobile Java Media (Graphics & Sounds) | 2 | 2004-10-29 09:17 |
| Sound in Midp 2.0 stalls | astraton2001 | Mobile Java Media (Graphics & Sounds) | 4 | 2004-03-25 07:58 |
| sound bug (possibly) on 6610 | alex_crowther | Mobile Java Media (Graphics & Sounds) | 2 | 2004-02-05 12:44 |
| Nokia Smart Expert - solve this sound problem | tsoh_tan | Mobile Java Media (Graphics & Sounds) | 0 | 2003-10-30 05:36 |