11cdef extern void android_sound_queue(int , char * , char * , long long , long long )
22cdef extern void android_sound_play(int , char * , char * , long long , long long )
33cdef extern void android_sound_stop(int )
4+ cdef extern void android_sound_seek(int , float )
45cdef extern void android_sound_dequeue(int )
56cdef extern void android_sound_playing_name(int , char * , int )
67cdef extern void android_sound_pause(int )
@@ -11,15 +12,17 @@ cdef extern void android_sound_set_secondary_volume(int, float)
1112cdef extern void android_sound_set_pan(int , float )
1213
1314cdef extern int android_sound_queue_depth(int )
15+ cdef extern int android_sound_get_pos(int )
16+ cdef extern int android_sound_get_length(int )
1417
1518channels = set ()
1619volumes = { }
1720
1821def queue (channel , file , name , fadein = 0 , tight = False ):
1922
2023 channels.add(channel)
21-
22- real_fn = file .name
24+
25+ real_fn = file .name
2326 base = getattr (file , " base" , - 1 )
2427 length = getattr (file , " length" , - 1 )
2528
@@ -28,13 +31,16 @@ def queue(channel, file, name, fadein=0, tight=False):
2831def play (channel , file , name , paused = False , fadein = 0 , tight = False ):
2932
3033 channels.add(channel)
31-
34+
3235 real_fn = file .name
3336 base = getattr (file , " base" , - 1 )
3437 length = getattr (file , " length" , - 1 )
3538
3639 android_sound_play(channel, name, real_fn, base, length)
3740
41+ def seek (channel , position ):
42+ android_sound_seek(channel, position)
43+
3844def stop (channel ):
3945 android_sound_stop(channel)
4046
@@ -70,20 +76,23 @@ def unpause_all():
7076def pause_all ():
7177 for i in channels:
7278 pause(i)
73-
79+
7480def fadeout (channel , ms ):
7581 stop(channel)
7682
7783def busy (channel ):
7884 return playing_name(channel) != None
7985
8086def get_pos (channel ):
81- return 0
87+ return android_sound_get_pos(channel)
88+
89+ def get_length (channel ):
90+ return android_sound_get_length(channel)
8291
8392def set_volume (channel , volume ):
8493 android_sound_set_volume(channel, volume)
8594 volumes[channel] = volume
86-
95+
8796def set_secondary_volume (channel , volume ):
8897 android_sound_set_secondary_volume(channel, volume)
8998
0 commit comments