473,395 Members | 1,679 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,395 software developers and data experts.

how do i play mp3 using php

realin
254 100+
hi guys,

As the subject says, how can i play mp3 or any other format of music on my website.. it should be a kinda background music. I would prefer to learn and write at my own rather using a readymade library.. thanks :)
Aug 29 '07 #1
4 21617
nathj
938 Expert 512MB
hi guys,

As the subject says, how can i play mp3 or any other format of music on my website.. it should be a kinda background music. I would prefer to learn and write at my own rather using a readymade library.. thanks :)
Hi realin,

You can do this with an embedded object:

[html]
<embed src="music.mp3" width="145" height="60" autostart="true"></embed>
[/html]
Change the file name to where ever it is and away to go. There are a whole buch of options for this sort of thing, but the above should get you going at least.

Cheers
nathj
Aug 31 '07 #2
Purple
404 Expert 256MB
Hi All,

Just as a word of caution, <embed> whilst widely supported in browsers is non standard and as such is not part of any html or xhtml specification. To be compliant you may want to take a look at <object> here

Regards Purple
Aug 31 '07 #3
nathj
938 Expert 512MB
Hi All,

Just as a word of caution, <embed> whilst widely supported in browsers is non standard and as such is not part of any html or xhtml specification. To be compliant you may want to take a look at <object> here

Regards Purple
Hi Purple,

Good catch there. I must be honest I have never used embed for that reason.

I answered the question i a bit of rush, and basically threw the problem at my IDE and it came up with <embed> and so my answer was born.

Sorry if this has caused problems.

Cheers
nathj
Aug 31 '07 #4
Purple
404 Expert 256MB
Hi nathj,

No problem with me, we are all here to help some and learn some..

Regards Purple
Aug 31 '07 #5

Sign in to post your reply or Sign up for a free account.

Similar topics

6
by: Andrew Poulos | last post by:
As a follow on to the 'fun' I had with IE I'm now trying to play sounds using an Object tag (no Embed) in MZ. Sadly whenever 'playButton' gets clicked MZ says that "audObj.Play is not a function":...
1
by: Ron Provost | last post by:
Hello, I'm developing a piece of software to assist illiteraate adults to learn to read. I'm trying to figure out how, if possible, to make audio playback asynchrnous but still controllable. ...
3
by: Hai Ly Hoang | last post by:
I want to play a piece of music in .NET application How to do that ? Thanks a lot !
3
by: Jared | last post by:
I'm using the first code sample below to play WAV files stored as embedded resources. For some reason I *occasionally* get scratching and crackling. I'm using a couple WAVs that ship with...
9
by: Morris Neuman | last post by:
Im working with VS 2005 and trying to use a Hyperlink field in a datagrid to play a wave file that is not located in the website folders but is in a plain folder on the same machine, windows 2003...
13
by: anil.rita | last post by:
When the user chooses an AV file to play, based upon the type of file, I want to use the default installed media player to play it. I am wondering if this is a good way - any alternatives,...
5
by: | last post by:
Hello, I am wrtting a program that does some sound effects... the files are stored in a subfolder in the application folder... and I check the existence of the files before calling the method to...
5
by: Slickuser | last post by:
I want to play a note in C# .NET giving a frequency like the one show below. Is it possible? C 261.6 C# 277.2 D 293.7 D# 311.1 E 329.6
26
by: Jake Barnes | last post by:
I did a search on the newsgroup comp.lang.javascript. I was searching for "how to play a sound with Javascript". I'm somewhat suprised that the majority of entries are from the 1990s, and there are...
8
by: raylopez99 | last post by:
I have the latest version of Visual Studio 2008 Professional, which allows you to create resource files (this is the .resx file, no?), unlike the Express version, which does not. I am trying to...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

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.