Thread: output of sound

  1. #1
    Registered User
    Join Date
    Sep 2010
    Posts
    1

    output of sound

    hi guys...

    i'm just a new user of c programming...

    my situation is, i've juz got my assignment whereas i need to construct a coding that after compiling it with Microcontroller PIC will give an output in term of sound...

    My problem is...
    I don't know how to call the file of the sound(mp3,.wav, etc) in my coding...
    even i also don't know how to start it...

    please... i need your help...
    <<<snipped email address - this is a forum, not a dating site >>>
    Last edited by Salem; 10-08-2010 at 05:44 AM. Reason: snippage

  2. #2
    Banned ಠ_ಠ's Avatar
    Join Date
    Mar 2009
    Posts
    687
    If you do not know how to start then ask your teacher

    No one here is going to do your homework for you
    ╔╗╔══╦╗
    ║║║╔╗║║
    ║╚╣╚╝║╚╗
    ╚═╩══╩═╝

  3. #3
    Registered User
    Join Date
    May 2009
    Posts
    4,183
    Quote Originally Posted by rafizahazifar View Post
    compiling it with Microcontroller PIC will give an output in term of sound...
    Edit: Note asking for people to email you directly with the answer is NOT considered proper on most web forums.

    You will likely NOT use an file with embedded micro-controller.
    If the hardware has no file system you will NOT be using files!
    First, Does it have a file system?

    Second, what is going to make the sound?

    Third, which PIC Micro-controller is your project using?

    If no file system, you will likely be use an array or buffer to hold the notes to be played.
    The data is likely to be an constant data table on the 8 bit PICs usually with a max size of 128 bytes(This is using PIC Assembly; C may or may not have 128 byte limit) .

    ( Teaching Assistance in an 8 bit PIC class; note, I am not an expert on PICs or C programming. Just know more than 90% of the students in the class.)

    And, remember read the data-sheet on the MCU; at least the section that covers how the chip is going to drive the speaker/other hardware to make noise.

    Tim S.
    Last edited by stahta01; 10-07-2010 at 07:43 PM.

  4. #4
    Registered User
    Join Date
    Aug 2010
    Posts
    9
    you'll need a codec to play mp3 files,
    wavs are easier afaik beyond the header theres just raw data,
    if theres enough onboard memory you can load the raw sample data (you'll need to find a way to get this info), into a wave table and read it out the dac or pwm module if the pic has either of these, google will probably give you more code examples if you search it,

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. 2d game
    By JordanCason in forum Game Programming
    Replies: 5
    Last Post: 12-08-2007, 10:08 PM
  2. DirectX Question
    By bladerunner627 in forum Game Programming
    Replies: 2
    Last Post: 04-04-2005, 11:55 AM
  3. DirectSound - multiple sounds
    By Magos in forum Game Programming
    Replies: 9
    Last Post: 03-03-2004, 04:33 PM
  4. Help me modify my Sound Server
    By zdude in forum C Programming
    Replies: 1
    Last Post: 05-14-2003, 05:15 PM
  5. ALSA sound problem in Linux
    By MathFan in forum Tech Board
    Replies: 0
    Last Post: 04-24-2003, 10:05 AM