0

以下是我的config.php

<?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

<?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 上运行,当我尝试运行脚本时,这是我得到的输出

c:\xampp\htdocs\shoutcast>php run.php
Playing:

虽然预期的输出是

c:\xampp\htdocs\shoutcast>php run.php
Playing: anak-ayam.mp3

我想创建自己的在线广播服务器请帮忙。我该如何解决这个问题?

4

1 回答 1

0

既然你使用的是windows。你能改变mp3from的路径吗

$CONFIG['music_dir'] = './music/anak-ayam.mp3';

类似于

$CONFIG['music_dir'] = 'C:/music/anak-ayam.mp3';
于 2013-06-03T04:13:59.010 回答