According to the documentation Kivy 2.0.0 audio will likely not seek unless played first. However, I cannot get it to seek at all with the attached simple code on Windows 11. It always plays from the beginning and the position is always 0,
Also, I tried to schedule a delay using Clock and the audio does not play at all. What am I missing?
Here is an example. Change the audiofile and the seek time as you like.
from kivy.app import App
from kivy.lang import Builder
from kivy.uix.boxlayout import BoxLayout
from kivy.core.audio import SoundLoader
kv = """
<AudioPlayer>:
size_hint_y: None
height: 48
Button:
text: 'Play & Seek'
on_release: root.play()
Button:
text: 'Stop'
on_release: root.stop()
BoxLayout:
orientation: 'vertical'
Label:
text: 'Audio Test'
AudioPlayer:
"""
class AudioPlayer(BoxLayout):
def __init__(self, **kwargs):
self.sound = SoundLoader.load('PinkPanther60.wav')
super().__init__(**kwargs)
def play(self):
self.sound.play()
self.sound.seek(55)
def stop(self):
self.sound.stop()
class AudioTestApp(App):
def build(self):
return Builder.load_string(kv)
AudioTestApp().run()
--
You received this message because you are subscribed to the Google Groups "Kivy users support" group.
To unsubscribe from this group and stop receiving emails from it, send an email to kivy-users+...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/bae3c129-d42e-480c-9266-b0ff902330e9n%40googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/043c90e2-f231-41bd-9e23-f1e90b9c4ef8n%40googlegroups.com.
Looks like I’m using Gstreamer.
[INFO ] [Logger ] Record log in C:\Users\ellio\.kivy\logs\kivy_21-11-19_0.txt
[INFO ] [deps ] Successfully imported "kivy_deps.gstreamer" 0.3.1
[INFO ] [deps ] Successfully imported "kivy_deps.angle" 0.3.0
[INFO ] [deps ] Successfully imported "kivy_deps.glew" 0.3.0
[INFO ] [deps ] Successfully imported "kivy_deps.sdl2" 0.3.1
[INFO ] [Kivy ] v2.0.0
[INFO ] [Kivy ] Installed at "C:\Users\ellio\kivy_venv_200\lib\site-packages\kivy\__init__.py"
[INFO ] [Python ] v3.9.1 (tags/v3.9.1:1e5d33e, Dec 7 2020, 17:08:21) [MSC v.1927 64 bit (AMD64)]
[INFO ] [Python ] Interpreter at "C:\Users\ellio\kivy_venv_200\Scripts\python.exe"
[INFO ] [Factory ] 186 symbols loaded
[INFO ] [Image ] Providers: img_tex, img_dds, img_sdl2, img_pil (img_ffpyplayer ignored)
[INFO ] [AudioGstplayer] Using Gstreamer 1.18.0.0
[INFO ] [Audio ] Providers: audio_gstplayer, audio_sdl2 (audio_ffpyplayer ignored)
[INFO ] [Window ] Provider: sdl2
[INFO ] [GL ] Using the "OpenGL" graphics system
[INFO ] [GL ] GLEW initialization succeeded
[INFO ] [GL ] Backend used <glew>
[INFO ] [GL ] OpenGL version <b'4.6.0 NVIDIA 466.79'>
[INFO ] [GL ] OpenGL vendor <b'NVIDIA Corporation'>
[INFO ] [GL ] OpenGL renderer <b'NVIDIA GeForce RTX 2060/PCIe/SSE2'>
[INFO ] [GL ] OpenGL parsed version: 4, 6
[INFO ] [GL ] Shading version <b'4.60 NVIDIA'>
[INFO ] [GL ] Texture max size <32768>
To view this discussion on the web visit https://groups.google.com/d/msgid/kivy-users/048c5cbc-61e0-4bdc-8913-f5449ddef0f6n%40googlegroups.com.