Sound question

This is a discussion on Sound question within the Game Programming forums, part of the General Programming Boards category; Hi, [n00b] I have a question about exactly what I can use for sound. Here is what I'm trying to ...

  1. #1
    Registered User
    Join Date
    Jul 2003
    Posts
    13

    Sound question

    Hi,

    [n00b]
    I have a question about exactly what I can use for sound. Here is what I'm trying to do:
    Code:
    char sento[]="Text goes here.";
    
    size=strlen(sento);  
    for(x=0;x<size;x++)
    {   
           sleep(40); 
           printf("%c",sento[x]);
    }
    I use this so that I can print my text one letter at a time. I also want to be able to have a note sound off for each letter as well (anyone familiar with Shining Force for Sega Genisis would know exactly what I'm talking about). Is it possible to stick something inside the for loop to accomplish this?

    [/n00b]
    "Whether you think that you can, or that you can't, you are usually right."

  2. #2
    Registered User BillBoeBaggins's Avatar
    Join Date
    Oct 2003
    Posts
    107
    I don't think you can play specific "wave" files in true DOS, more like large sets of soundbytes per se that are fed to your sound card.

    But nonetheless... Look at this..
    sound problems

    especially what this guy says...

    Bubba
    Programming a sound engine in DOS is no simple feat. Unless you are fairly adept at assembly or very good at C, I would not attempt it. But if you like self-inflicted pain you can check out www.creative.com and go to their developer center. They have the old DOS manuals (legacy manuals) there which will tell you how to code for the older sound cards. Note that most modern cards do not support DOS at all so this information might not help. Also some of Creative's so-called backward compatibility with DOS does not always work very well. To program a DOS sound engine you should NOT be in a DOS session or you will get some very wacky results.
    or look at...
    playing sounds in a DOS program


    ...Maybe just start learning Windows Development and use the API to play sounds in time with your graphics (which is relatively simple)

    Good luck no matter what you do!

    Am adding this information onto this post....
    Check out this site and download MidPak/DigPak (Drivers specifically designed for DOS)..
    http://falkoris.tripod.com/libs.htm

    Check out this page (which is very long) that mentions MidPak and DigPak....
    http://sunsite.lanet.lv/ftp/mirror/x...ocs/gamfaq.txt
    ..for additional support look at...
    http://courses.ece.uiuc.edu/ece291/r...und/sound.html
    http://www.gamedev.net/reference/articles/article261.asp
    Last edited by BillBoeBaggins; 11-26-2003 at 01:53 PM.

  3. #3
    Super Moderator VirtualAce's Avatar
    Join Date
    Aug 2001
    Posts
    9,596
    Yes you can play specific wave files in DOS just as you would in Windows or DirectX. All sound files are made up of samples that comprise the larger sound file.

    But each file is fed to the DSP in chunks, usually 128 to 256 bytes at a time. Keep in mind that if you do this in DX you won't have to worry about the primary buffer...but in DOS you will.

    I went to www.creative.com recently and they no longer have the legacy manual that I have on my hard drive. I have the PDF file for programming the SB16 family of cards. This may not sound useful but it is. Most of the underlying circuitry for SoundBlaster has not been changed. To get them to play sounds is quite similar for each generation of sound card. Also Creative provides some free SDKs for EAX 2.0 and EAX 3.0 as well as some other sound libraries.

  4. #4
    l'Anziano DavidP's Avatar
    Join Date
    Aug 2001
    Location
    Plano, Texas, United States
    Posts
    2,738
    Hey, Bubba, any chance you can send me that pdf file over email? It would be interesting to take a look at.
    My Website

    "Circular logic is good because it is."

  5. #5
    Registered User
    Join Date
    Jul 2003
    Posts
    13
    Thank you very much for the information
    "Whether you think that you can, or that you can't, you are usually right."

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Design layer question
    By mdoland in forum C# Programming
    Replies: 0
    Last Post: 10-19-2007, 05:22 AM
  2. Low latency sound effects
    By VirtualAce in forum Game Programming
    Replies: 0
    Last Post: 12-21-2004, 01:58 AM
  3. Question on sound in a game of mine.
    By Vanished in forum C++ Programming
    Replies: 4
    Last Post: 12-09-2002, 05:46 PM
  4. Question on sound in a game of mine
    By Vanished in forum Game Programming
    Replies: 2
    Last Post: 12-09-2002, 01:56 PM
  5. Very simple question, problem in my Code.
    By Vber in forum C Programming
    Replies: 7
    Last Post: 11-16-2002, 03:57 PM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21