Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > How to import sounds into a C program

Reply
Thread Tools

How to import sounds into a C program

 
 
Gene
Guest
Posts: n/a
 
      08-11-2007
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.

 
Reply With Quote
 
 
 
 
Walter Roberson
Guest
Posts: n/a
 
      08-11-2007
In article < .com>,
Gene <> wrote:
>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.
--
If you lie to the compiler, it will get its revenge. -- Henry Spencer
 
Reply With Quote
 
 
 
 
Malcolm McLean
Guest
Posts: n/a
 
      08-11-2007

"Walter Roberson" <> wrote in message
news:f9jrag$4vg$...
> 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.

--
Free games and programming goodies.
http://www.personal.leeds.ac.uk/~bgy1mm


 
Reply With Quote
 
santosh
Guest
Posts: n/a
 
      08-11-2007
Malcolm McLean wrote:

>
> "Walter Roberson" <> wrote in message
> news:f9jrag$4vg$...
>> 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.


And they have been:

<http://www.google.com/search?&q=Portable+sound+API>

 
Reply With Quote
 
Flash Gordon
Guest
Posts: n/a
 
      08-11-2007
santosh wrote, On 11/08/07 12:33:
> Malcolm McLean wrote:
>
>> "Walter Roberson" <> wrote in message
>> news:f9jrag$4vg$...
>>> 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.

>
> And they have been:
>
> <http://www.google.com/search?&q=Portable+sound+API>


Although it is only portable to some systems. I can't, for example, see
mention of SCO, AIX or HPUX in the supported systems. I'm sure others
can find other systems not supported. It is also, obviously, beyond the
scope of standard C.
--
Flash Gordon
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Sounds from my laptop like water gurgling - strange comp sounds.wma (0/1) joevan Computer Support 16 06-29-2010 04:30 PM
Import data from Excel file or text file into database in ASP.NET program bienwell ASP .Net 2 06-17-2006 03:57 AM
Close program sounds...too many Gerry Wolf Computer Support 1 09-28-2004 08:25 PM
curious sounds in midi program help please Dave Wiz Computer Support 7 08-30-2004 06:21 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57