473,320 Members | 1,722 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,320 software developers and data experts.

Playing music files

I have a list of file descriptions in a list box that is filled via a php
mysql select. I know the name of the file that is described by the file
that is select from that list box. It is an audio file. I have a "Play"
button. I know how to get to a section of code when the user clicks that
button.

Question 1: What do I have to do to make it play on the the user's machine
when he clicks the "Play" button.
Question 2: When he terminates the music, I want it to stay on the original
page.

Shelly
Jul 17 '05 #1
4 2472
try this, it used to work on my old server, but now its a bit wonky,
does work though. link to:
script.php?song=coolsong.mp3 ,

and make this the contents thereof:

header("Cache-control: private");
header("Content-type: audio/x-mpegurl");
header("Content-disposition: inline;filename=stream.m3u");
echo "http://www.yourdomain.com/mp3z/".$_get['song'];

should start streaming that song in the users player of choice. User
should never actually leave the page, the song will just start.

for some wierd reason, it now loads about ten songs in my player, the
last one being the actual song:
<br -->
b><br -->
<br -->
b><br -->
<br -->
b><br -->
<br -->
b><br -->
<br -->
b><br -->
<br -->
b><br -->
<br -->
b><br -->
bipolarbears--Bi Polar Bears - demo 2002 - 03 - jumbalaya

what's with the <BR>s??? there is no <BR> in my script that i am
linking to. Only thing that's changed is the server, and i had to
change permissions on the text file that i'm using for a counter (which
is supposed to increment, used to, not now)

Jul 17 '05 #2
"juglesh" <ju*********@hotmail.com> wrote in message
news:11**********************@g47g2000cwa.googlegr oups.com...
try this, it used to work on my old server, but now its a bit wonky,
does work though. link to:
script.php?song=coolsong.mp3 ,

and make this the contents thereof:

header("Cache-control: private");
header("Content-type: audio/x-mpegurl");
header("Content-disposition: inline;filename=stream.m3u");
echo "http://www.yourdomain.com/mp3z/".$_get['song'];


Thanks. I tried this. It brought up the windows media player skin, but the
message I got was that it was unable to play any of the playlist.

First, it asked for a login to the server.
Second, it said it was unable to play that type even though it plays that
file locally on my machine.

Shelly

Jul 17 '05 #3

"Shelly" <sh************@asap-consult.com> wrote in message
news:iL********************@comcast.com...
I have a list of file descriptions in a list box that is filled via a php
mysql select. I know the name of the file that is described by the file
that is select from that list box. It is an audio file. I have a "Play"
button. I know how to get to a section of code when the user clicks that
button.

Question 1: What do I have to do to make it play on the the user's
machine when he clicks the "Play" button.
Question 2: When he terminates the music, I want it to stay on the
original page.

Shelly


One more thing. I originally posted that I wanted it selected from a list
of files. Do I do this with?

header("Location: myfile.php?song=thesong.mid");

Shelly
Jul 17 '05 #4

"Shelly" <sh************@asap-consult.com> wrote in message
news:M7********************@comcast.com...

"Shelly" <sh************@asap-consult.com> wrote in message
news:iL********************@comcast.com...
I have a list of file descriptions in a list box that is filled via a php
mysql select. I know the name of the file that is described by the file
that is select from that list box. It is an audio file. I have a "Play"
button. I know how to get to a section of code when the user clicks that
button.

Question 1: What do I have to do to make it play on the the user's
machine when he clicks the "Play" button.
Question 2: When he terminates the music, I want it to stay on the
original page.

Shelly


One more thing. I originally posted that I wanted it selected from a list
of files. Do I do this with?

header("Location: myfile.php?song=thesong.mid");

Shelly


Yes. I answered my own question.

Shelly
Jul 17 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

12
by: Marian Aldenhövel | last post by:
Hi, I am trying to make pygame play music on windows. This simple program: import pygame,time pygame.init() print "Mixer settings", pygame.mixer.get_init() print "Mixer channels",...
5
by: Lauren Wilson | last post by:
Hi Folks, I have an Access 2k app that is often run on a LAN with several users. Unfortunately there is one feature that fails to work in that setup. Our app allows the user to play WAV audio...
4
by: Sumaira Ahmad | last post by:
Hi, Is there any way of playing songs and downloading songs from a server onto a client machine. I want to develop an application such as a music portal which allows clients to play songs that...
5
by: Tom W | last post by:
Ok, hi evryon now I swear I put this post up yesterday but I cant find it anywhere so ill put it up again So I'm making a program to play music but the code ive got for the open dialog thing isn't...
4
by: Doug van Vianen | last post by:
Hi, I am using Visual Basic 6 to generate web pages that can be used by the members of our seniors' computer club to create e-cards that include their own pictures. I wish to include background...
14
by: gnarl | last post by:
Hello all, I'm developing a site in PHP4 for a music artist, who wants music to play across all their pages. I have loaded a simple flash applet to play the music, but every time the visitor to...
2
by: FlashForumKB | last post by:
Here is a chance for you to make my developers look bad. I have hired these guys to development my website which, in part, has music demos available to my users. These demos must include the...
2
by: sumaabey | last post by:
Thanks in advance. <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <html> <head> <title>Untitled Document</title> <meta...
4
by: mustardcharlie | last post by:
My first question on this site, so hi to all. I have recently constructed a database for my daughter's (12) mp3 files so that she can easily move them to and from her mp3 player. This works fine...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.