You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Jun 26, 2023. It is now read-only.
I'm writing a python program that plays a beep before I then start a spotify track. My code is:
# -*- coding: utf-8-*-
import socket
import json
import subprocess
def connect():
global TCP_IP
global TCP_PORT
global BUFFER_SIZE
global s
TCP_IP = '127.0.0.1'
TCP_PORT = 6602 #spop
BUFFER_SIZE = 4096
s = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
s.connect((TCP_IP, TCP_PORT))
s.send("")
data = s.recv(BUFFER_SIZE)
print "CONNECT: received data:", data
def communicate(message):
global TCP_IP
global TCP_PORT
global BUFFER_SIZE
global s
s.send(message)
data = ""
while 1:
block = s.recv(1024)
data = data + block
if "]}" in block: break
processed = json.loads(data)
return processed
def close_connection():
global s
s.close()
def play_test():
subprocess.call("mplayer beep_hi.wav", shell=True)
The track sounds a little bit fast and corrupted. If I remove the play_test() call (the call that produces the beep) then the track plays normally.
Can anyone advise what I'm doing wrong? Is my sound interfering with the sound setup for spop? The beep file is a 44.1KHz stereo wav. I'd really appreciate any help people can provide - it has me foxed!
Thanks
Martin
The text was updated successfully, but these errors were encountered:
Hi, sorry for the delayed answer.
Apparently you're using the ao output. Could you please tell me which driver is libao configured to use on your system? This is usually in /etc/libao.conf. And similarly, which audio output is mplayer using? (alsa, PulseAudio, ... ?)
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Hi All,
I'm writing a python program that plays a beep before I then start a spotify track. My code is:
and from another python module I call:
The track sounds a little bit fast and corrupted. If I remove the play_test() call (the call that produces the beep) then the track plays normally.
Can anyone advise what I'm doing wrong? Is my sound interfering with the sound setup for spop? The beep file is a 44.1KHz stereo wav. I'd really appreciate any help people can provide - it has me foxed!
Thanks
Martin
The text was updated successfully, but these errors were encountered: