Go to advanced search

by brandonandrsn
Thu Jan 31, 2019 12:58 am
Forum: Graphics, sound and multimedia
Topic: Sound Loop GPIO Music Box
Replies: 9
Views: 1931

Re: Sound Loop GPIO Music Box

OK. By default I think pygame has 8 channels but I think you can increase this . As for the code, I was just thinking something along the lines of: import pygame.mixer from pygame.mixer import Sound from gpiozero import Button from signal import pause pygame.mixer.init() button_sounds = { Button(21...
by brandonandrsn
Tue Jan 29, 2019 11:07 am
Forum: Graphics, sound and multimedia
Topic: Sound Loop GPIO Music Box
Replies: 9
Views: 1931

Re: Sound Loop GPIO Music Box

One way to do this would be to make the sound play on a particular channel. You can then use the "get_busy" method of the channel to check if the sound is playing. Your on_pressed method would then call a function that checks if a sound is playing. If it isn't, then it starts it. If it is, then it ...
by brandonandrsn
Mon Jan 28, 2019 10:18 pm
Forum: Graphics, sound and multimedia
Topic: Sound Loop GPIO Music Box
Replies: 9
Views: 1931

Re: Sound Loop GPIO Music Box

im looking to do something similar. play sound on GPIO button press and continue to play loop until the GPIO is pressed a second time. so far my code is this. it loops the sound while button is pressed but stops once released. looking to build a crude loop sampler box import pygame.mixer from pygame...

Go to advanced search