Microphone output / input?

Blitz3D Forums/Blitz3D Programming/Microphone output / input?

Guy Fawkes(Posted 2012) [#1]
Hi all. I have a question. Does anyone know of a DLL and example code, showing how to send microphone input through the web, and back from the web? basically, an example with microphone support. I would like to add microphone support to my game. :)


Thanks! :)


ClayPigeon(Posted 2012) [#2]
I may be wrong, but I believe either BASS or FMOD has that capability.


Guy Fawkes(Posted 2012) [#3]
Do they have an example I can use to learn how to send and receive microphone inputs?

Thanks! :)


Guy Fawkes(Posted 2012) [#4]
Bump. its been over 24 hours.


Ross C(Posted 2012) [#5]
.

Last edited 2012


jfk EO-11110(Posted 2012) [#6]
I have no working sample, but this is the way I'd do it:

get the code sample from the archives that shows how to reverse play a WAV, this will allow you to have access to the actual sampling data, excluding the header. I'd cut the sound in little packets of eg. 200ms, pack it with zip (somewhere in code) and send them over UDP or TCP by my own. Not sure if ZIP is a good choice, you may instead use a lossy audio codec instead. No matter what, seems like you need to write a lot to the harddrive since Blitz doesn't support editing sounds in ram. Maybe you can do that with a hack or with BASS or so.


Guy Fawkes(Posted 2012) [#7]
Thanks, Jfk :)


Rroff(Posted 2012) [#8]
BlitzAL has the ability to capture audio data from an external source however I'm not sure if there is any direct buffer access to read the raw data which would be required to send it over a network.

Last edited 2012


Guy Fawkes(Posted 2012) [#9]
Is there another way of reading the Raw Data?


Rroff(Posted 2012) [#10]
There may be some way with the RtlMoveMemory API function but its not something I've looked into.


jfk EO-11110(Posted 2012) [#11]
remember the good old times when we had to read the printerport to sample the 8 Bit amplitude of a homebrew AD converter, consisting of a couple of resistors :)

Probably harder than the raw data access using RtlMoveMemory may be to control the microphone. Maybe there are ways using ome of windows embedded multimedia APIs. You'd need to study a lot of DLL stuff, tho. BlitzAL, as Rroff suggested, sounds good to me.


Guy Fawkes(Posted 2012) [#12]
Does anyone have an example of streaming a file live with a server, while a client downloads it, and can stream the file too? that would EASILY solve this problem.


Guy Fawkes(Posted 2012) [#13]
bump. its been over 12 hours.


RifRaf(Posted 2012) [#14]
over 12 hours? is that your medication interval ?

Seriously, if nobody answered after reading it once, why would your reminder help them come up with a solution for you? Folks usually bump good information, not their own "gimme" requests. Wait and see if somebody answers like polite person, stop trying to force a quick reply.

Last edited 2012


Guy Fawkes(Posted 2012) [#15]
Rifraf, go away. Stop hijacking my thread.

Last edited 2012


K(Posted 2012) [#16]
Well...
BlitzAL has the ability to capture audio data from an external source

1) Look into that. Search engines are wonderful.
may be some way with the RtlMoveMemory API function

2) Look into that. He said he wasn't sure. Research RtlMoveMemory.
Does anyone have an example of streaming a file live with a server...?

3) No. If they did, they would have said so THREE WEEKS ago. As it is, there are close to half-a-dozen great suggestions already in this thread.
You have all the clues; if you are to be a programmer you have to understand logic, and more often than not, you are on your own. But, since you know that other games are using this, you know it can be done, yes? Research how they did it.


BlitzSupport(Posted 2012) [#17]
Using this method, you can record to a simple WAV file. Really crude example:



Note that you'll first have to create a plain text file called "winmm.decls" in the "Blitz3D\userlibs" folder (create that folder if it doesn't exist), containing this definition:

.lib "winmm.dll"

mciSendStringA (lpszCommand*, lpszReturnString*, cchReturn, hwndCallback)


(If you already have a winmm.decls file -- unlikely -- just add the mciSendStringA line, if it's not already there.)

I don't really know the details of how this works, other than you send strings via mciSendStringA to have the work done for you, but the archived page below shows what the string commands mean. It might even be possible to record to memory, but I don't know if that's the case.

http://web.archive.org/web/20091027051607/http://www.geocities.com/smigman.geo/mci/wav.html

Anyway, it's one simple way to get mic input at least.


BlitzSupport(Posted 2012) [#18]
BTW I assume that in a real game you would call the DeleteFile command, then the first two mci commands, then while your game loops, test if x seconds have passed, then call the third one to stop.


Guy Fawkes(Posted 2012) [#19]
I just tried, and it didnt record anything to any file :/


Guy Fawkes(Posted 2012) [#20]
Also, how do I grab EVERY byte, and put it into a variable?


Guy Fawkes(Posted 2012) [#21]
.

Last edited 2012


Guy Fawkes(Posted 2012) [#22]
Anyone?


Guy Fawkes(Posted 2012) [#23]
Anyone?...


Guy Fawkes(Posted 2012) [#24]
How do I grab all the bytes, and put them into a variable?


Ross C(Posted 2012) [#25]
No-one knows


Guy Fawkes(Posted 2012) [#26]
sure they don't -.- u all hate me for what i USED to do. I can sense that. But I've changed, and it's time u change too -.-


Ross C(Posted 2012) [#27]
Wait a minute. You have been relentlessly bumping this post, even though it never left the top 5 threads in the forum, and you've "changed"?

Seriously, if someone knows, they will post. If I knew, and it was something simple, I would post. Your asking for stuff that most folks on here probably haven't done. It's quite an advanced topic, especially for blitz3d, and no-one probably has the time to go away and learn this. If you don't understand how to do it, your going to have lots of follow up questions (based on your past), and need further help (you've done that in this thread)

You scare people off from helping you unfortunetly.


Guy Fawkes(Posted 2012) [#28]
So do u with ur relentless whining about what i do and don't do wrong. and I'm sick of it. -.-


Ross C(Posted 2012) [#29]
bump

Last edited 2012


Guy Fawkes(Posted 2012) [#30]
double bump. for god sake. u continue to argue with me, when i only speak the truth. mods lock this plz... im sick and tired of being ridiculed.


Naughty Alien(Posted 2012) [#31]
..if i offer 100% workable solution for your problem, what Ill get in return?


Guy Fawkes(Posted 2012) [#32]
ya know. ur a stingy jerk. Most ppl would WANT to help because its the right thing to do. U know what, get out of my thread. I dont want to see u again if ur gonna be stingy.


K(Posted 2012) [#33]
Okay, enough. Here is the solution: Open up the command reference, read carefully the entire file/stream section and TCP section. Put something together based on that, test it, then post it. We will review it.


Naughty Alien(Posted 2012) [#34]

ya know. ur a stingy jerk. Most ppl would WANT to help because its the right thing to do. U know what, get out of my thread. I dont want to see u again if ur gonna be stingy.


..i helped you before with fully working examples(waypoints with smoothing at turning points), ready to go, and it seems, you always throwing rocks on to people..so, in other words, you are ready to take away for free someone work, without sweat and when someone asking near zero request from you, you find that wrong..ihhh..i didnt ask much at all, anyway, if you change your mind, let me know..peace..


Bobysait(Posted 2012) [#35]
@Thundros :

A little more respect would not deserve you, do you know it ?

Whatever...

You can capture the input audio device using the "WaveInOpen" command from the windows dll package.
Problem for you : You 'll have to wrap it, creating a c++ dll to export it for blitz3d or deal with banks to seed parameters.

I have already done this before but HEY !
Beg me ! ... implore me ! ... supplicate me !
and maybe I 'll give you the code (or not, try if you dare ^^)

You want to be a jackass ? Ok ! So, We'll be too

Last edited 2012