473,809 Members | 2,876 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Playing Music

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

Nov 15 '05 #1
5 2666
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**********@n wrdmz03.dmz.ncs .ea.ibs-infra.bt.com>,
Malcolm <re*******@btin ternet.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
16155
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", pygame.mixer.get_num_channels() pygame.mixer.music.set_volume(1.0) pygame.mixer.music.load('file1.mp3)
4
2183
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 www.deutronium.de.vu || www.deutronium.tk
4
2414
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 reside on a Web Server. So does the web server need to send the song as an attachment to the ASP.NET Web application or does it do streaming?? And how is it achieved?? Please any ideas or any hints will be highly appreciated.
5
1951
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 working. This is what iv'e go \\\\\\\ Private Sub MenuItem2_Click(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles BtnOpen.Clic Dim OpenFileDialog( Dim openFile As New System.Windows.Forms.OpenFileDialo openFile.DefaultExt =...
3
2377
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 Internet Explorer object model ). Now, I want the name of the track in the person's nickname from MSN Messenger ( the "now playing" info that actually comes from the Windows Media Player Music Plugin ). Does anybody know how to do that ( in VB.Net...
14
4022
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 the site moves to a different page the music starts again. The artist would like the music to play continuously. I can only think of three possible ways to solve this, and I am not happy with any of them.
4
5073
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 or music which is: OLE.DoVerb (vbOLEPrimary) But the one to stop or interupt the sound I could not find it. Please let know
11
2186
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 script so im not asking for a script but help learning how to make one. Thanks, Death Slaught
2
1514
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 http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
0
9721
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9600
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 effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
0
10633
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
1
10375
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10114
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9198
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7651
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 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 a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5548
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
3
3011
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.