Audio Input

Discussion and feedback on Construct 2

Post » Wed Jun 20, 2012 10:15 pm

I know it's been brought up before, but when I updated C2 recently and saw the camera access in the objects, I was wondering if these means there is a chance that microphone access might be feasible? I am not super clear on the tech. specs, but it sounds like the <device> tag might hold promise?
B
17
S
3
G
4
Posts: 91
Reputation: 3,929

Post » Wed Jun 20, 2012 11:21 pm

The User Media plugin (which does webcam input) will eventually support audio input too. However, it's still being specified by the W3C, and no browsers support a way to get audio input yet, so it will have to come later.

Out of curiosity, what are you hoping to use it for? Just want to make sure it gets implemented in a way which lets everyone do what they want.
Scirra Founder
B
359
S
214
G
72
Posts: 22,949
Reputation: 178,544

Post » Thu Jun 21, 2012 1:55 am

I wrote a game design doc for a competition that was trying to find new ways to use voice control in games; my idea was that the player controls the character by using pitch + pan detection. A middle pitch, high pitch, and low pitch, combine with Left-Center-Right audio locations, to make a 9 way control, like a joystick, which controls a tunnel-racing character. There were some other thoughts, If you were interested, here's a PDF!

I was going to try to build it in Flash, but honestly, it's a bit over my head right now, I was just curious if it would be feasible in construct since I am much more familiar w/ (and like much more) what you've done with C2.the_chosen_byte2012-06-21 01:56:48
B
17
S
3
G
4
Posts: 91
Reputation: 3,929

Post » Thu Jun 21, 2012 11:59 am

@the_chosen_byte Yes the getusermedia webkit has been think to allow cam recording and microphone recording too. So it just a question of time before this features will be really available.
B
16
S
5
G
3
Posts: 298
Reputation: 5,240

Post » Thu Jun 21, 2012 12:13 pm

@all : in fact, getUserMedia isn't usable to do that particular use case.
While you can access the microphone with gUM(), it's not designed to inject the audio flux inside an <audio> object. It's designed to stream it over a connection (like audio caht over WebRTC).
What you need is the Streams W3C API, which no browser support yet.
For a client I'm currently developing a plugin that uses Flash as a fallback to do that. You use a non-visible flash code block to access the mic. The actionscript then encode the RAW data from the mic in a MP3 and a OGG file (to cover all browsers). Those two files are then base64 converted and sent to Javascript via ExternalInterface.
So, in the end, my C2 webapp can use mp3 or ogg files from the microphone !
That project will be done at the end of the week, I'm going to release the plugin here after that.
Some time in the future, I'll add some JS code to do some basic audio processing on that data...
B
33
S
9
G
6
Posts: 709
Reputation: 6,704

Post » Thu Jun 21, 2012 2:29 pm

@Pode, that sounds like a pretty solid work-around, nice one. I look forward to checking that project out!
B
17
S
3
G
4
Posts: 91
Reputation: 3,929


Return to Construct 2 General

Who is online

Users browsing this forum: Ethan and 11 guests