How to import sounds into a C program

Discussion in 'C Programming' started by Gene, Aug 11, 2007.

  1. Gene

    Gene Guest

    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.
    Gene, Aug 11, 2007
    #1
    1. Advertising

  2. In article <>,
    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
    Walter Roberson, Aug 11, 2007
    #2
    1. Advertising

  3. "Walter Roberson" <-cnrc.gc.ca> 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
    Malcolm McLean, Aug 11, 2007
    #3
  4. Gene

    santosh Guest

    Malcolm McLean wrote:

    >
    > "Walter Roberson" <-cnrc.gc.ca> 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>
    santosh, Aug 11, 2007
    #4
  5. Gene

    Flash Gordon Guest

    santosh wrote, On 11/08/07 12:33:
    > Malcolm McLean wrote:
    >
    >> "Walter Roberson" <-cnrc.gc.ca> 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
    Flash Gordon, Aug 11, 2007
    #5
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Pleg
    Replies:
    10
    Views:
    839
    Benjamin Todd
    Mar 23, 2006
  2. =?Utf-8?B?SGVyYg==?=

    Playing Sounds

    =?Utf-8?B?SGVyYg==?=, Nov 13, 2005, in forum: ASP .Net
    Replies:
    3
    Views:
    389
    Jason Gogela
    Nov 15, 2005
  3. David Alex Lamb

    Managing sounds

    David Alex Lamb, Apr 9, 2005, in forum: Java
    Replies:
    1
    Views:
    385
    Jason Herald
    Apr 9, 2005
  4. Tom Leylan

    J2ME 'click" sounds

    Tom Leylan, Jan 1, 2006, in forum: Java
    Replies:
    14
    Views:
    1,205
    Tom Leylan
    Jan 13, 2006
  5. Replies:
    11
    Views:
    12,162
Loading...

Share This Page