mjbrusso / AudioPlayer

audioplayer is a cross platform Python 3 package for playing sounds (mp3, wav, ...). It provides the key features of an audio player, such as opening a media file, playing (loop/block), pausing, resuming, stopping, and setting the playback volume.
MIT License
37 stars 11 forks source link

PLAYING state doesn't change to CLOSED #4

Open rolandomunoz opened 4 years ago

rolandomunoz commented 4 years ago

Windows 10 Python 3.8.5

Dear Marcos:

I tried the following code and found that when an audio finishes playing, the AudioPlayer().state remains as PLAYING. Is this the expected behaviour?

import audioplayer

f1 = r'C:\Users\rolan\Desktop\test2\test1.wav'
a = audioplayer.AudioPlayer(f1)

while True:
  char = input('> ')
  if char == 'p':
    a.play(0)
  if char == 'i':
    print(a.position)
    print(a.state)
    print(a.duration)
  elif char == 'q':
    break

Thank you for sharing your package! I was looking for something like this!