UK Webmaster Talk - Online Marketing - SEO


 

php & mysql radio

This is a discussion on php & mysql radio within the Php and MySQL forums, part of the Programming / Scripting / Coding category; Ok, heres what i want to do. my cousins all have bands and i am making a radio thing similar ...


Go Back   UK Webmaster Talk - Online Marketing - SEO > Website Design & Development > Programming / Scripting / Coding > Php and MySQL

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Notices

Reply

 

LinkBack Thread Tools Display Modes
Old 02-07-2005, 14:19   #1 (permalink)
Newbie
 
Join Date: May 2005
Posts: 6
iTrader: 0 / 0%
hdshngout is on a distinguished road
Exclamation php & mysql radio

Ok, heres what i want to do. my cousins all have bands and i am making a radio thing similar to the thing on launch.yahoo.com. I set up a database with the bands name, song title, and the embeded music code. I need to know how to set up the radio page so it moves to a random record (song) after the current record(song) is over. This is really important and i need it asap. if anyone could help, i would be extremely greatful.
hdshngout is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-07-2005, 23:50   #2 (permalink)
Cool Newbie
 
Join Date: Jun 2005
Posts: 28
iTrader: 0 / 0%
Sameth is on a distinguished road
Default

is it like choosing random mp3s out of a directory?
Sameth is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-07-2005, 23:52   #3 (permalink)
Super Moderator
 
Lewis's Avatar
 
Join Date: Apr 2005
Location: Leics, UK
Posts: 1,000
iTrader: 0 / 0%
Lewis is just really nice
Send a message via AIM to Lewis Send a message via MSN to Lewis Send a message via Skype™ to Lewis
Default

this is what me and kyle wanted to do, this will be an interesting post to follow.
__________________
NewsBarrel.com
Everything is banal and jejune, There is a planetary conspiracy against the likes of you and me in this idiot constituency of the moon, Well, he knew exactly who to blame, And we call upon the author to explain.
Lewis is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 02-07-2005, 23:56   #4 (permalink)
Senior Member
 
Join Date: Jun 2005
Posts: 389
iTrader: 0 / 0%
FrozenDice will become famous soon enough
Default

How are you embeding the music file? Are you using simply windows media player, or some sort of java applet?

I would recomend you don't use windows media embeded, this causes problems. The early windows media players couldn't stream, and this would leave out mac and linux users.

I don't know how you would know when the song was over unless you use scripting which you can put into things played with windows media. I forget its name but theres a way (in movies at least), where at a certian point in the file you can do stuff like launch webpages, etc.

You could have it launch a php script, that goes to your next song. This is your best bet, but remember, its incompadible with alot of things.
FrozenDice is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 03-07-2005, 00:11   #5 (permalink)
Cool Newbie
 
Join Date: Jun 2005
Posts: 28
iTrader: 0 / 0%
Sameth is on a distinguished road
Default

hmm, isn't there some type of windows media player playlist? you could have a php script make that random and just get the user to click that.
Sameth is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 04-07-2005, 01:54   #6 (permalink)
Newbie
 
Join Date: May 2005
Posts: 6
iTrader: 0 / 0%
hdshngout is on a distinguished road
Talking

I just made an m3u playlist. I made the playlist in notepad, is there any way to set it up to shuffle in the playlist?
hdshngout is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-07-2005, 06:02   #7 (permalink)
Cool Newbie
 
Join Date: Jun 2005
Posts: 28
iTrader: 0 / 0%
Sameth is on a distinguished road
Default

sure, is there a different song each line? if thats the way theyre set up which i'm not sure of then read the file into an array like @file and then do like file[random number here] and pick that one.
Sameth is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Old 09-07-2005, 06:09   #8 (permalink)
Cool Newbie
 
Join Date: Jun 2005
Posts: 28
iTrader: 0 / 0%
Sameth is on a distinguished road
Default

okay then you asked to explain here it is. you put the file in where it says the mix here and then it opens it counts the ammount of lines (songs) picks a random one and outputs it as what song your listening too. I don't know the code to embedd music with wmp so you take the $lines[$rand] and that file is what you send to the embeded player.
Code:
<?php
srand((double)microtime()*1000000); 
$lines = file('themixhere');
$amt = count($lines);
$rand = rand(0, $count); 
echo $lines[$rand];
?>
Sameth is offline  
Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
Reply

Tags
mysql, php, radio

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On

Similar Threads

Thread Thread Starter Forum Replies Last Post
Save Internet Radio. Fedz General Webmaster Discussion 5 07-05-2007 20:25
WMT Radio? Morphmaster Comments / Suggestions 73 25-07-2005 15:27
Graphical Radio/Checkbox NEW FrozenDice Website Development Forum 0 13-07-2005 19:42
The computer world radio live! Lewis Ads, Offers & Services 1 07-05-2005 11:54


All times are GMT +1. The time now is 17:57.


Powered by vBulletin® Version 3.7.3
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Friendly URLs by vBSEO 3.2.0
UK Webmaster Forum © WebmasterTalk.co.uk | Design by Forbairt

Ad Management by RedTyger

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41