首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >Shoutcast服务器php无法运行

Shoutcast服务器php无法运行
EN

Stack Overflow用户
提问于 2013-06-03 03:37:41
回答 1查看 271关注 0票数 0

以下是我的config.php

代码语言:javascript
复制
<?php
$CONFIG['music_dir'] = './music/anak-ayam.mp3';
$CONFIG['encoder_path'] = 'lame.exe';
$CONFIG['bitrate'] = '64';
$CONFIG['server_name'] = 'Test Shoutcast Server';
$CONFIG['server_genre'] = 'Random';
$CONFIG['server_url'] = 'http://localhost:45401/';
$CONFIG['server_public'] = '0';
$CONFIG['metadata_interval'] = '8192';

以下是我的run.php

代码语言:javascript
复制
<?php // $Id$

require 'config.php';
require 'server.php';
require 'shoutcast.php';
require 'audiosource.php';
require 'http.php';

set_time_limit(0);

$Server = new Server();

$AudioSource = new AudioSource();
$AudioSource->bitrate = $CONFIG['bitrate'];
$AudioSource->encoder = $CONFIG['encoder_path'];
$AudioSource->metadata_interval = $CONFIG['metadata_interval'];
$AudioSource->populate_playlist($CONFIG['music_dir']);
$AudioSource->open_next_file();

$Shoutcast = new Shoutcast();
$Shoutcast->server = &$Server;
$Shoutcast->source = &$AudioSource;
$Shoutcast->metadata_interval = $CONFIG['metadata_interval'];
$Shoutcast->server_name = $CONFIG['server_name'];
$Shoutcast->server_genre = $CONFIG['server_genre'];
$Shoutcast->server_url = $CONFIG['server_url'];
$Shoutcast->server_public = $CONFIG['server_public'];
$Shoutcast->hook_to_server();

$HTTP = new HTTP();
$HTTP->server = &$Server;
$HTTP->shoutcast = &$Shoutcast;
$HTTP->hook_to_server();

$Server->listen();

我在Windows 7上运行,当我尝试运行脚本时,这就是我得到的输出

代码语言:javascript
复制
c:\xampp\htdocs\shoutcast>php run.php
Playing:

而预期的输出是

代码语言:javascript
复制
c:\xampp\htdocs\shoutcast>php run.php
Playing: anak-ayam.mp3

我想自己创建自己的在线无线电服务器,请帮助。我该怎么解决这个问题?

EN

回答 1

Stack Overflow用户

发布于 2013-06-03 04:13:59

由于您使用的是windows .Can,所以可以将mp3的路径更改为

代码语言:javascript
复制
$CONFIG['music_dir'] = './music/anak-ayam.mp3';

到某种程度上

代码语言:javascript
复制
$CONFIG['music_dir'] = 'C:/music/anak-ayam.mp3';
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16889708

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档