'No Sound - RPi Cam Web Interface
I have a project about streaming camera via Web Interface. I use the RPi Cam Web Interface.
I have an issue with the sound. I want to run .mp3 .ogg or .wav, code is work in thonny or therminal but when i use the userbuttons, the code works but the sound doesnt work. By the way userbuttons run the python code via .sh files.
I tried to run this command but it doesnt work too. ( sudo adduser www-data audio )
i am using pygame and i have written these codes which is following line;
import serial
import pygame
import time
ser=serial.Serial('/dev/serial0',115200,timeout=1)
ser.write(b"Hello World")
ser.close()
pygame.init()
asound = pygame.mixer.sound('/home/pi/02.ogg') # i used the .mp3 and .wav but the problem is not solved
achannel = pygame.mixer.Channel(1)
achannel.stop()
achannel.play(asound)
time.sleep(10)
does anyone know how to solve this problem ?
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
