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

Playing Music

Is there a way to play music(MP3 or Wav) using c or c++?

Nov 15 '05 #1
5 2635
If you are developing on Windows then take a look at the Media Player
SDK at
http://msdn.microsoft.com/library/de...aplayersdk.asp

David Barkol
www.neudesic.com

Nov 15 '05 #2

<a.*************@gmail.com> wrote

Is there a way to play music(MP3 or Wav) using c or c++?

The short answer is use a platform-specific library.

The long answer is no. Music inherently demands parallel processing and
accurate timing so that the soundtrack is not interrupted by the other tasks
the computer is doing. There is no way to achieve this in ANSI C, though of
course there are manyextensions available which will give you some parallel
capacity.
Nov 15 '05 #3
In article <da**********@nwrdmz03.dmz.ncs.ea.ibs-infra.bt.com>,
Malcolm <re*******@btinternet.com> wrote:
The long answer is no. Music inherently demands parallel processing and
accurate timing so that the soundtrack is not interrupted by the other tasks
the computer is doing.


Say wot?

You've made a poor assumption, that the computer -has- other things
to do. That wasn't the case on the PDP-11 I studied "computer music" on.

And even if there were other things to do, sound boards have had queues
for over a decade: you toss some samples in, go and service your other
task, come back and put more samples in.

C doesn't make any real-time guarantees, but if you have output
queues you can probably fudge it *well enough* for most purposes.
[People tend not to expect 32 note polyphony in 128 voice harmony while
defragmenting the disk at the same time as they are doing a full
virus scan.]
More of a problem, perhaps, is that C provides no mechanism for
writing to fixed hardware addresses. (Conversion between integral
types and pointers is implementation defined, and in practice usually
only gives access to process virtual memory unless one is working at
the kernel or device driver level.)
--
Oh, to be a Blobel!
Nov 15 '05 #4
Checkout the source of mpg123, its written in c and it plays mp3 songs
on linux platforms with ease.

Nov 15 '05 #5
well, im developing in dos(thats right, no windows)

can someone help me with the code of mpg123? i downloaded it, but i
feel it is sorta complex...i am not able to understand some of the
coding(Im just 16 yrs old...)

Nov 15 '05 #6

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",...
4
by: cody | last post by:
Is there a way to play mod-music in .NET? I know in the standardlibraries there is nothing for mod-music but does anybody know of a free third party component that can be used for that? -- cody...
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...
3
by: Tommy DN | last post by:
I've made a program that displays the track that's playing on a (internet)radiostation. The name of the "now playing" track comes from the radiostation's website ( from the statusbar using the...
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...
4
by: Benzerari | last post by:
Hi All; Please, if any one knows the visual basic code, to be added to a Stop button in order to stop playing some sound of (*.Wav) type. I have achieved to find the code for start playing sound...
11
Death Slaught
by: Death Slaught | last post by:
i need a music player on my site ive tried the embed tag but i cant ever get the music to play also i would like to have script that lets my users download a file but i know nothing about downloading...
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...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
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?
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
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
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
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.