[RESOLVED] Working on Game Project That Involves Sound and Graphics-VBForums
Results 1 to 14 of 14

Thread: [RESOLVED] Working on Game Project That Involves Sound and Graphics

  1. #1

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    9,197

    Resolved [RESOLVED] Working on Game Project That Involves Sound and Graphics

    I'm up against a rock and a hard spot. In my project I have coded to allow user to speak into a microphone and record the sound and at the same time display some graphics. My question is how can I substitute a sound buffer for the microphone and record the sound from a byte array instead of from the microphone? Normally, the user will speak into a microphone, record what he says and display some graphics that animate in sync with the voice as it is being recorded. Now, I also need to be able to allow user to input his own pre-recorded sound, play it back as it is being read in and display some graphics or have the sound read into a buffer first then from the buffer record it and also display some graphics at the same time which ever is the best or easiest way to go. I am using waveIn and waveOut API calls and would like to keep it that way as everything else in the project uses these APIs.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  2. #2
    New Member
    Join Date
    May 2013
    Posts
    1

    Re: Working on Game Project That Involves Sound and Graphics

    I think you would need some kind of program to do that

  3. #3
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    5,018

    Re: Working on Game Project That Involves Sound and Graphics

    What language are you using vb6, vb.net, c++, c#?

    I've personally never worked with the waveIn and waveOut API's, but working with sound period is a difficult task.

  4. #4
    The DirectXpert Jacob Roman's Avatar
    Join Date
    Aug 2004
    Location
    Miami Beach, FL
    Posts
    5,074

    Re: Working on Game Project That Involves Sound and Graphics

    Personally I would have prefered DirectSound, which is part of DirectX. It's much much faster and better than those API's.

  5. #5
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    587

    Re: Working on Game Project That Involves Sound and Graphics

    Its not quite clear to me what you want. I guess I need some coffee first.

    These API's are the closed to the soundcard, and are the underlaying for DirectX. So you are on the right track.

  6. #6

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    9,197

    Re: Working on Game Project That Involves Sound and Graphics

    I suppose to put it in simple terms is how do I play a sound from a .wav file using waveOut and show animated graphics simultaneously.

    For example:

    I load a sound file "sound.wav" into my app and using the waveOut APIs play the sound from that file while showing some type of animated graphics at the same time where the animated graphics are in sync with the sound. A good example of this would be like when you turn on your sound equipment (a stereo set for example) and play a song from a CD and you see a series of colored lights on your set that seem to bounce up and down in sync with the music being played. I want to do something similar to this except it will not be bouncing colored lights; it will be some other graphics, but the idea is the same.

    BTW: I am programming in VB6.
    Last edited by jmsrickland; Jun 27th, 2013 at 02:46 AM.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  7. #7
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    587

    Re: Working on Game Project That Involves Sound and Graphics

    I guess NightWalker gives the solution here:

    http://www.vbforums.com/showthread.p...e-Wave-Display

  8. #8

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    9,197

    Re: Working on Game Project That Involves Sound and Graphics

    OMG! Why do you point me to my own thread? That is my project, not his. It is not what I want. If it was what I wanted then I would have no reason to open this thread. That project loads a file, makes a sine wave first, then plays the sound. I want the be able to create the graphics at the same time as the sound is being played, not created first then play.
    Last edited by jmsrickland; Jun 27th, 2013 at 12:52 PM.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  9. #9
    Super Moderator dday9's Avatar
    Join Date
    Mar 2011
    Location
    South Louisiana
    Posts
    5,018

    Re: Working on Game Project That Involves Sound and Graphics

    Well I have to back out of the thread as I don't know how to work with an outdated language(no offence), but I will leave on "The little experience I've had with advanced sounds have been pretty difficult in comparison with everything else I've done."

  10. #10

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    9,197

    Re: Working on Game Project That Involves Sound and Graphics

    Quote Originally Posted by dday9 View Post
    Well I have to back out of the thread as I don't know how to work with an outdated language(no offence), but I will leave on "The little experience I've had with advanced sounds have been pretty difficult in comparison with everything else I've done."
    Then show me how you would do it in the language of your choice.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  11. #11

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    9,197

    Re: Working on Game Project That Involves Sound and Graphics

    OK, maybe I'm asking too complex of a question so let me re-define my question

    How can I play small segments of a wave file? Let's say I have a file that has 612000 bytes of sound data. Now I know I can send the entire 612000 bytes to the waveOutwrite API and it will play the entire sound file. No problem there. But let's say I want to only send a few at a time, like 3000 bytes or whatever at a time. So, how do I make a loop that pulls 3000 bytes out of the 612000 byte array, sends those bytes to the play API and continue on in the loop until I have sent all 612000 bytes knowing that one of the outputs will not be exactly 3000 bytes?


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  12. #12
    Fanatic Member namrekka's Avatar
    Join Date
    Feb 2005
    Location
    Netherlands
    Posts
    587

    Re: Working on Game Project That Involves Sound and Graphics

    Quote Originally Posted by jmsrickland View Post
    OMG! Why do you point me to my own thread? That is my project, not his. It is not what I want. If it was what I wanted then I would have no reason to open this thread.
    Hmmm.....
    Well as long as "waveOutGetPosition" gives you an idea what position is in the sound buffer, I guess you can use this to plot your graphics.

    And yes...I didn't download your project because I haven't used VB6 for quit some time. And yes I used those API's quit often. And ......

    And I'm sorry it wasn't quit clear to me what you WANT.

  13. #13

    Thread Starter
    PowerPoster
    Join Date
    Jan 2008
    Posts
    9,197

    Re: Working on Game Project That Involves Sound and Graphics

    Actually, namrekka, although pointing me to my own project was totally out of step I actually found a big clue to my problem in one of your own VB6 projects which I am quite surprised you didn't even post a link to that one.

    Anyway, it doesn't matter now as I solved this myself.


    Anything I post is an example only and is not intended to be the only solution, the total solution nor the final solution to your request nor do I claim that it is. If you find it useful then it is entirely up to you to make whatever changes necessary you feel are adequate for your purposes.

  14. #14
    PowerPoster Nightwalker83's Avatar
    Join Date
    Dec 2001
    Location
    Adelaide, Australia
    Posts
    13,119

    Re: Working on Game Project That Involves Sound and Graphics

    Quote Originally Posted by jmsrickland View Post
    Anyway, it doesn't matter now as I solved this myself.
    Mind sharing the solution to the problem with us?
    when you quote a post could you please do it via the "Reply With Quote" button or if it multiple post click the "''+" button then "Reply With Quote" button.
    If this thread is finished with please mark it "Resolved" by selecting "Mark thread resolved" from the "Thread tools" drop-down menu.
    Please consider giving me some rep points if I help you a lot.
    Links to my code examples can now be found on my website: My websites
    Please rate my post if you find it helpful!
    Technology is a dangerous thing in the hands of an idiot! I am that idiot.

Posting Permissions

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



Featured


Click Here to Expand Forum to Full Width

Survey posted by VBForums.