How to import sounds into a C program

G

Gene

Hi, I'm a college student taking CS class, and for a project, I want
to import some music or sound files into a program I wrote in C. I've
read some stuff about using sndPlaySound or PlaySound but I have no
idea how to implement these. If anyone has any suggestions as to how
this can be done, or if it can be done at all, I'd appreciate it.
Thanks a lot.
 
W

Walter Roberson

Hi, I'm a college student taking CS class, and for a project, I want
to import some music or sound files into a program I wrote in C. I've
read some stuff about using sndPlaySound or PlaySound but I have no
idea how to implement these. If anyone has any suggestions as to how
this can be done, or if it can be done at all, I'd appreciate it.

You can use the facilities of standard C to read music or sound
files into memory, as they are just binary files that can be
interpreted if you have sufficient patience and documentation.
However, there are no facilities in standard C to turn data
in memory into actual sound.

Neither sndPlaySound nor PlaySound are part of C itself. They
might be facilities provided by some particular operating system
or some third party library (that is operating system specific.)

Working with sound is inherently OS specific. You will need to
research this matter in your OS documentation or a newsgroup
that deals with your particular OS.
 
M

Malcolm McLean

Walter Roberson said:
Working with sound is inherently OS specific. You will need to
research this matter in your OS documentation or a newsgroup
that deals with your particular OS.
It's IO. So inherently tied to hardware, although the same sound could be a
compression wave in air, or an electrical impluse on a phone line, or some
sort of visual representation for deaf people.
However there is no reason why portable audio interfaces cannot be
developed.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,764
Messages
2,569,564
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top