小编muy*_*coi的帖子

使用 python-shout 创建 icecast2 服务器的多个音频流

我正在尝试创建一个网络广播服务器来一次流式传输 3 个源。我正在使用 python 使用 python-shout 库为 icecast2 创建一个源客户端。我对语言(python)不太熟悉。但是,我得到了一个示例程序,它可以满足我的需要,而且我已经根据需要对其进行了调整。但是,我只能创建两个流,之后,我收到如下所示的错误消息。我不知道我做错了什么,所以我希望你们能帮我弄清楚。

hostname ="localhost"
port= 8000
password = "password"

import shout
import sys
import threading
from glob import glob
from random import shuffle,choice

class RunStream (threading.Thread):
   def __init__ (self, channel_mount, music_directory, station_url, genre,name,         description, bitrate="128", samplerate="44100", channels="5",music_format="mp3", ogv=0):
    #connection to icecast
    global hostname,port,password
    self.song_conter= 0
    self.s = shout.Shout()
    self.s.audio_info = {shout.SHOUT_AI_BITRATE:bitrate,   shout.SHOUT_AI_SAMPLERATE:samplerate, shout.SHOUT_AI_CHANNELS:channels}
    self.s.name = name
    self.s.url = station_url
    self.s.mount = channel_mount
    self.s.port = port
    self.ogv = ogv
    self.s.password = password
    self.s.genre = …
Run Code Online (Sandbox Code Playgroud)

python audio audio-streaming icecast

6
推荐指数
1
解决办法
4146
查看次数

标签 统计

audio ×1

audio-streaming ×1

icecast ×1

python ×1