Results 1 to 10 of 10

Thread: QBasic Background Sound - Alternate found

  1. #1

    Thread Starter
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Resolved QBasic Background Sound - Alternate found

    Hi Guys,

    Hmmm very quite over this side of the forum

    Anyways, I have created a QBasic front end app that runs under DOS (Win98SE).

    It works well, has animated stary background etc. I now want to add SOUND

    I dont want to use the PC Speaker (Play/Sound is out), and want to use the
    external speakers via my SoundCard (16bit ISA SoundBlaster - it works).
    I have sucessfully used a 3rd party app - SBPlay.exe but of course it runs, then returns process to my app.

    In short, I need a method of playing background sound - prefferably .WAV format.

    I have tried various QBasic .WAV code to no avail.

    So - Ideas time.

    How are you guys implimenting background sound (MOD, WAV, etc)???



    Cheers 'n' many beers,
    Bruce.
    Last edited by Bruce Fox; Jul 26th, 2006 at 04:09 PM.

  2. #2
    Member
    Join Date
    Mar 2006
    Posts
    43

    Re: QBasic Background Sound

    Here is what I do for sound.
    This does not work for .WAV, .MID, ect. It only puts notes and QBASIC created sounds.

    Notes / Melody
    PLAY "e8 d8 g8 a#4 T180 b2"
    T180 is the tempo
    e8 ect are the notes followed by how they are played (eighth, half, quarter)

    Sound Created by: Pitch, Length
    SOUND 1000, 18
    1000 is the pitch, 18 is the length
    Here is a bomb dropping:
    FOR I = 4000 TO 1000 STEP -5
    SOUND I, .1
    NEXT I

    And for a "beep" (MS "Ding")
    BEEP

    You can use MB for background music... (check QBASIC help)
    Hope this is what you were looking for...

    -- pSY cO.
    Last edited by pSY cO.; May 29th, 2006 at 06:13 AM. Reason: adding to post
    I can help with C++, Java (some), vB, Ruby/RoR, Python, JavaScript, and TorqueScript

  3. #3
    New Member
    Join Date
    Jul 2006
    Location
    Manila. Philippines
    Posts
    12

    Re: QBasic Background Sound

    Beyond what pSY have suggested, I dont think QB supports sound card based file formats. If my memory serves me right, QB was created way ahead of any sound cards being used today.

    I have seen however, sample programs that shows QB can execute machine language instructions using Read/Data functions. But that was a very complex series of codes.

  4. #4
    PowerPoster
    Join Date
    Feb 2006
    Location
    East of NYC, USA
    Posts
    5,691

    Re: QBasic Background Sound

    Quote Originally Posted by AioDCS
    I have seen however, sample programs that shows QB can execute machine language instructions using Read/Data functions. But that was a very complex series of codes.
    Quite common in those days. Just a string composed of all the machine language code bytes, VarPtr used to find the address of the first byte and Call to execute it. Using Read/Data to poke the bytes into RAM was okay for 8 bit single-processing computers, but got a bit hairy under Windows (and you can't easily execute data space or write to executable space). Most computers (PC, Apple II, Commodore, etc.) had some implementation that allowed it.

    All you need is an assembler to assemble the code.
    The most difficult part of developing a program is understanding the problem.
    The second most difficult part is deciding how you're going to solve the problem.
    Actually writing the program (translating your solution into some computer language) is the easiest part.

    Please indent your code and use [HIGHLIGHT="VB"] [/HIGHLIGHT] tags around it to make it easier to read.

    Please Help Us To Save Ana

  5. #5

    Thread Starter
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: QBasic Background Sound

    Hi Guys,

    I realised that QB was unable to do what I wanted as far as playing background WAVs go. I was aware of the composed string, but I needed something dynamic.

    I rewrote the app in C++ and used Allegro to handle the images and concurrent sounds - works well.

    I must admit, It was great getting back to the early days of BASIC. It is humbling to revisit how powerful it actualy was (for it's time of course).


    Cheers.

  6. #6
    New Member
    Join Date
    Jul 2006
    Posts
    6

    Re: QBasic Background Sound - Alternate found

    Greetings,
    It IS possible to utilize background sound in QB, however it was to my understanding a bit of a hack and of course required Windows for such a task to be accomplished. To my understanding as well it was a add-on library specificly designed for QB, and most notabily the most popular method of sound (as well as background sound). Now the details are vague, as I've never personally used the library and only seen it in action (a friend of mine was one of those fanatics)a couple years ago, but I do know it is possible.

    I thought I would enlighten you on this and tell you to search for the QB community sites for such a library.

    Even then I don't know how mant of those sites still exist because several who was actively still writing those libraries have finally gave QB it's final farewell and joined/started the FreeBasic project, but there still resides a number of them who simply refused to switch even that so... =P

    So if you don't mind alittle research, and don't mind having Windows running in the background then to let you know there is a sound card functionality available for QB, you just gotta be willing to look. (...and I'm not. lol)

  7. #7

    Thread Starter
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: QBasic Background Sound - Alternate found

    Quote Originally Posted by KrisKhaos
    Greetings,
    It IS possible to utilize background sound in QB, however it was to my understanding a bit of a hack and of course required Windows for such a task to be accomplished. ......
    I thought I would enlighten you on this and tell you to search for the QB community sites for such a library.
    Hi, as I mentioned in my original post.......... it's DOS!

    ( I have no problem doing it in Windows. I have successfully done it in DOS using C++)

  8. #8
    New Member
    Join Date
    Jul 2006
    Posts
    6

    Re: QBasic Background Sound - Alternate found

    Quote Originally Posted by Bruce Fox
    Anyways, I have created a QBasic front end app that runs under DOS (Win98SE).
    My Bad, the Win98SE made me think that is was running.

  9. #9

    Thread Starter
    INXSIVE Bruce Fox's Avatar
    Join Date
    Sep 2001
    Location
    Melbourne, Australia
    Posts
    7,429

    Re: QBasic Background Sound - Alternate found

    No probs, thanks for the reply anyways

    It may help someone else in any event.


    Cheers.

  10. #10
    Hyperactive Member
    Join Date
    Aug 2006
    Posts
    367

    Re: QBasic Background Sound - Alternate found


Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width