-
Jun 24th, 2013, 01:13 PM
#1
[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.
-
Jun 25th, 2013, 06:47 AM
#2
New Member
Re: Working on Game Project That Involves Sound and Graphics
I think you would need some kind of program to do that
-
Jun 25th, 2013, 10:01 AM
#3
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.
-
Jun 26th, 2013, 12:43 AM
#4
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.
-
Jun 26th, 2013, 02:11 AM
#5
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.
-
Jun 27th, 2013, 02:42 AM
#6
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.
-
Jun 27th, 2013, 10:24 AM
#7
Re: Working on Game Project That Involves Sound and Graphics
-
Jun 27th, 2013, 12:46 PM
#8
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.
-
Jun 27th, 2013, 12:50 PM
#9
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."
-
Jun 27th, 2013, 01:38 PM
#10
Re: Working on Game Project That Involves Sound and Graphics
Originally Posted by dday9
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.
-
Jun 27th, 2013, 08:32 PM
#11
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.
-
Jun 28th, 2013, 08:18 AM
#12
Re: Working on Game Project That Involves Sound and Graphics
Originally Posted by jmsrickland
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.
-
Jun 28th, 2013, 09:42 AM
#13
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.
-
Jun 29th, 2013, 11:01 PM
#14
Re: Working on Game Project That Involves Sound and Graphics
Originally Posted by jmsrickland
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.
https://get.cryptobrowser.site/30/4111672
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|