@BENCHMARK1989: I have not experienced this myself, but it seems to be a common problem. I haven't seen a real fix for it, but more of a work around. I've seen on 2 sites to run pygame.mixer.init() twice. So:
@metalx1000@BENCHMARK1989 Did either of you find a better solution for this? I'm having the same "there is no soundcard" issue with pygame 1.9.1 in Mint Katya but calling pygame.init() twice didn't work for me (and my soundcard works fine). I think it might have to do with my graphics card. I had to switch my soundcard to the motherboard using alsamixer because mint defaulted it to my graphics card which isn't a soundcard. Also, this was the most useful Youtube comment thread ever.
@rblakem: Hard to say, my desktop doesn't get that error message, but I feel like I saw it on my laptop a week or 2 ago. I'm not at my laptop right now, but I feel like even though I go that message the sound still worked. Can you confirm that there is no sound after that message is displayed?
@BENCHMARK1989:This is good to know because if that is the case, maybe we should all be doing that. If I make a game that runs fine on my computer, it may not run on yours because of this, so I guess I should do this in all my script just to be sure.
@metalx1000 I googled that error message and also found some mailing lists with that fix but it wont work for me =/...never the less if it fixes that error on some other computers maybe its good to do the init twice in all scripts...
I wondered if it could be a problem with the hdmi output because python has now 2 output devices and cant detect the right one....but thats just some thoughts I had!
Awesome tutorials! Couple of questions though, I noticed when adding sound it will only play if you use a .wav file. How do I make it play a .midi? Also how do I make the sound loop(play continuously).
@LOOK4B: those are good questions. I've never played a midi through PyGame, although I believe it is possible. Looping a sound is something I've done, but it's been a while. I've been meaning to do more PyGame tutorials. I'll put both of these on my list of things todo.
1. For compatibility with python3, add parenthesis after the 'play' message: sound.play()
2. Instead of exiting with just sys.exit(), it is better to first do pygame.quit() then do sys.exit(). Otherwise when it closes you'll get an abnormal termination program error ("pythonw.exe is not responding") when run from IDLE under Windows Vista.
3. Also, I think that pygame.display.update() might be a better choice than pygame.display.flip()
4. Also, you needn't import pygame.mixer. Since you've already imported pygame, referencing pygame.mixer.whatever works without explicitly importing pygame.mixer.
but my speakers and the volume on the video have 2 B turned up 2 the max. and i still have 2 go 2 "Master Volume" 2 turn that up a little 2 hear U'r tutorial.
Comment removed
TheRandomN 1 month ago
what operating system are u using?
TheHundefor 1 month ago
@TheHundefor: Video was made a while ago. But it looks like Linux Mint. Although the Python Script should work the same on all Operating Systems.
metalx1000 1 month ago
Comment removed
MilanorTSW200 4 months ago in playlist PyGame
You make everything so easy. Thank you!!!!
tekroundup 4 months ago
@tekroundup: I try to. I'm glad you found it helpful.
metalx1000 4 months ago
if these videos dont deserve thumbs up ...then which does...dude dese r awesome
elninogauje 8 months ago 4
@elninogauje: Thanks, I'm glad you like them. There are plenty more coming too.
metalx1000 8 months ago
are you using ubuntu
maradona640 9 months ago
@maradona640: Most likely I'm using Linux Mint. That is what I use in most my videos.
metalx1000 9 months ago
I always get "there is no soundcard" as error message and it doesnt play my wav file...
any idea what could be wrong here?? :)
btw...awesome tutorials!!
BENCHMARK1989 10 months ago
@BENCHMARK1989: I have not experienced this myself, but it seems to be a common problem. I haven't seen a real fix for it, but more of a work around. I've seen on 2 sites to run pygame.mixer.init() twice. So:
pygame.mixer.init()
pygame.mixer.init()
and the second time it works.
metalx1000 10 months ago
@metalx1000 @BENCHMARK1989 Did either of you find a better solution for this? I'm having the same "there is no soundcard" issue with pygame 1.9.1 in Mint Katya but calling pygame.init() twice didn't work for me (and my soundcard works fine). I think it might have to do with my graphics card. I had to switch my soundcard to the motherboard using alsamixer because mint defaulted it to my graphics card which isn't a soundcard. Also, this was the most useful Youtube comment thread ever.
rblakem 8 months ago
@rblakem: Hard to say, my desktop doesn't get that error message, but I feel like I saw it on my laptop a week or 2 ago. I'm not at my laptop right now, but I feel like even though I go that message the sound still worked. Can you confirm that there is no sound after that message is displayed?
metalx1000 8 months ago
@metalx1000 there is sound even after the error message displays. The game runs (as long as I don't launch it from eclipse).
rblakem 8 months ago
@BENCHMARK1989:This is good to know because if that is the case, maybe we should all be doing that. If I make a game that runs fine on my computer, it may not run on yours because of this, so I guess I should do this in all my script just to be sure.
metalx1000 10 months ago
@metalx1000 I googled that error message and also found some mailing lists with that fix but it wont work for me =/...never the less if it fixes that error on some other computers maybe its good to do the init twice in all scripts...
I wondered if it could be a problem with the hdmi output because python has now 2 output devices and cant detect the right one....but thats just some thoughts I had!
Thx for answering....search is going on! :)
(Maybe helpful: Ubuntu 10.10 with Python 2.6.6)
BENCHMARK1989 10 months ago
Awesome tutorials! Couple of questions though, I noticed when adding sound it will only play if you use a .wav file. How do I make it play a .midi? Also how do I make the sound loop(play continuously).
LOOK4B 1 year ago
@LOOK4B: those are good questions. I've never played a midi through PyGame, although I believe it is possible. Looping a sound is something I've done, but it's been a while. I've been meaning to do more PyGame tutorials. I'll put both of these on my list of things todo.
metalx1000 1 year ago
Very nice tutorials, Chris!
A couple of suggestions...
1. For compatibility with python3, add parenthesis after the 'play' message: sound.play()
2. Instead of exiting with just sys.exit(), it is better to first do pygame.quit() then do sys.exit(). Otherwise when it closes you'll get an abnormal termination program error ("pythonw.exe is not responding") when run from IDLE under Windows Vista.
3. Also, I think that pygame.display.update() might be a better choice than pygame.display.flip()
ncdave4life 1 year ago
4. Also, you needn't import pygame.mixer. Since you've already imported pygame, referencing pygame.mixer.whatever works without explicitly importing pygame.mixer.
ncdave4life 1 year ago
@ncdave4life: Thanks for the info. I have recently started using pygame.display.update() instead of pygame.display.flip().
I'll look into your other suggestions.
metalx1000 1 year ago
Lulz snotty boy
XAutomatedOwnerX 1 year ago
@XAutomatedOwnerX: Not sure what that mean.
You Straight Edge?
metalx1000 1 year ago
@metalx1000 The guys name was snotty boy the guy you downloaded the sound from
XAutomatedOwnerX 1 year ago
@XAutomatedOwnerX: Oh :)
metalx1000 1 year ago
OPENSOURCE AUDIO LOL
Zolga00 1 year ago
does this work with .avi files?
thrasher729 1 year ago
@thrasher729: I have not tried, but I think there is a python module called PyMedia for that sort of thing.
metalx1000 1 year ago
Does the program continue tracking Tux, when he is off screen? Could you remove him when he passes the screens edge?
De4dSpace 2 years ago
Yes, at this point it keeps tracking him.
You can stop it once it goes off the screen.
But, I'm are going to change things up here in a few more videos with him.
metalx1000 2 years ago
cool tutorials :D
but my speakers and the volume on the video have 2 B turned up 2 the max. and i still have 2 go 2 "Master Volume" 2 turn that up a little 2 hear U'r tutorial.
i'm not knocking U'r tutorial but i cant here it
;-)
john81078 2 years ago
Yes, People have informed me that my volume is low. Unfortunetly I recorded a lot of these videos all in one day.
So, there are still going to be some with low volume to come.
Sorry :(
metalx1000 2 years ago
I would re-record them, but I can hear them find when I turn the volume up. So, there not that bad.
metalx1000 2 years ago