Capture microphone audio using NaCl.

334 views
Skip to first unread message

Maciek D

unread,
Aug 20, 2013, 5:44:33 AM8/20/13
to native-cli...@googlegroups.com
Hi all.

I wanna know if its possible to capture microphone audio using ppb_audio_input_dev.h.
And if its possible, could you tell me what is needed and how I can do it ?

Thanks!

Nick Bray

unread,
Aug 20, 2013, 2:02:39 PM8/20/13
to native-cli...@googlegroups.com
It's a dev interface, which means three things:

1) The interface is not stable.  A future version of Chrome may not support the particular version of a dev interface you are using.  While working with dev interfaces, you need to be ready to recompile your application whenever Chrome is updated.
2) Dev interfaces are disabled if you distribute your app through the Chrome Web Store.  This means you can develop an app using the interface locally, but you can't distribute it until the interface is moved out of dev and stabilized.
3) The interface is not documented on the gonacl.com website.  The best place to find documentation about the interface is in the header file for the C version of the interface: $NACL_SDK_ROOT/include/ppapi/c/dev/ppb_audio_input_dev.h

I am unaware of any examples that demonstrate the interface.  This means your best bet is to start by reading the header file and experimenting.  Use PPB_Console to log what values the interface returns, this should help you understand how it behaves.  At that point if you have any specific questions, we can help fill in the gaps.  There is unfortunately no substitute for experimentation when dealing with bleeding edge interfaces.  :/


--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-di...@googlegroups.com.
To post to this group, send email to native-cli...@googlegroups.com.
Visit this group at http://groups.google.com/group/native-client-discuss.
For more options, visit https://groups.google.com/groups/opt_out.

Maciek D

unread,
Aug 21, 2013, 3:18:21 AM8/21/13
to native-cli...@googlegroups.com
How I can localy activate dev inetrface, so I dont get error about indicates failure due to an unavaible PAPPI interface (PP_ERROR_NOINTERFACE) ? 


W dniu wtorek, 20 sierpnia 2013 20:02:39 UTC+2 użytkownik Nick Bray napisał:
It's a dev interface, which means three things:

1) The interface is not stable.  A future version of Chrome may not support the particular version of a dev interface you are using.  While working with dev interfaces, you need to be ready to recompile your application whenever Chrome is updated.
2) Dev interfaces are disabled if you distribute your app through the Chrome Web Store.  This means you can develop an app using the interface locally, but you can't distribute it until the interface is moved out of dev and stabilized.
3) The interface is not documented on the gonacl.com website.  The best place to find documentation about the interface is in the header file for the C version of the interface: $NACL_SDK_ROOT/include/ppapi/c/dev/ppb_audio_input_dev.h

I am unaware of any examples that demonstrate the interface.  This means your best bet is to start by reading the header file and experimenting.  Use PPB_Console to log what values the interface returns, this should help you understand how it behaves.  At that point if you have any specific questions, we can help fill in the gaps.  There is unfortunately no substitute for experimentation when dealing with bleeding edge interfaces.  :/
On Tue, Aug 20, 2013 at 2:44 AM, Maciek D <maciej...@gmail.com> wrote:
Hi all.

I wanna know if its possible to capture microphone audio using ppb_audio_input_dev.h.
And if its possible, could you tell me what is needed and how I can do it ?

Thanks!

--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-discuss+unsub...@googlegroups.com.

Nick Bray

unread,
Aug 21, 2013, 1:12:49 PM8/21/13
to native-cli...@googlegroups.com
I assume you're using Chrome 27 or later?  Are you using the SDK that matches your version of Chrome?  For example, if you're using the pepper_canary SDK (Chrome 30) you will request "PPB_AudioInput(Dev);0.4" by default, but Chrome 29 only supports 0.3.  Version matching your SDK and your browser is important when dealing the dev interfaces.


To unsubscribe from this group and stop receiving emails from it, send an email to native-client-di...@googlegroups.com.

Maciek D

unread,
Aug 22, 2013, 10:21:00 AM8/22/13
to native-cli...@googlegroups.com
Thanks for your answer. 
Yesterday I was trying to run it on Chrome version 28 with PPB_AudioInput(DEV) 0.3. And now I'm using Chrome version 29 with PPB_AudioInput(DEV) 0.3 and still have same error. Don't I need to activate somehow dev interface?


W dniu środa, 21 sierpnia 2013 19:12:49 UTC+2 użytkownik Nick Bray napisał:
I assume you're using Chrome 27 or later?  Are you using the SDK that matches your version of Chrome?  For example, if you're using the pepper_canary SDK (Chrome 30) you will request "PPB_AudioInput(Dev);0.4" by default, but Chrome 29 only supports 0.3.  Version matching your SDK and your browser is important when dealing the dev interfaces.
On Wed, Aug 21, 2013 at 12:18 AM, Maciek D <maciej...@gmail.com> wrote:
How I can localy activate dev inetrface, so I dont get error about indicates failure due to an unavaible PAPPI interface (PP_ERROR_NOINTERFACE) ? 

W dniu wtorek, 20 sierpnia 2013 20:02:39 UTC+2 użytkownik Nick Bray napisał:
It's a dev interface, which means three things:

1) The interface is not stable.  A future version of Chrome may not support the particular version of a dev interface you are using.  While working with dev interfaces, you need to be ready to recompile your application whenever Chrome is updated.
2) Dev interfaces are disabled if you distribute your app through the Chrome Web Store.  This means you can develop an app using the interface locally, but you can't distribute it until the interface is moved out of dev and stabilized.
3) The interface is not documented on the gonacl.com website.  The best place to find documentation about the interface is in the header file for the C version of the interface: $NACL_SDK_ROOT/include/ppapi/c/dev/ppb_audio_input_dev.h

I am unaware of any examples that demonstrate the interface.  This means your best bet is to start by reading the header file and experimenting.  Use PPB_Console to log what values the interface returns, this should help you understand how it behaves.  At that point if you have any specific questions, we can help fill in the gaps.  There is unfortunately no substitute for experimentation when dealing with bleeding edge interfaces.  :/
On Tue, Aug 20, 2013 at 2:44 AM, Maciek D <maciej...@gmail.com> wrote:
Hi all.

I wanna know if its possible to capture microphone audio using ppb_audio_input_dev.h.
And if its possible, could you tell me what is needed and how I can do it ?

Thanks!

--
You received this message because you are subscribed to the Google Groups "Native-Client-Discuss" group.
To unsubscribe from this group and stop receiving emails from it, send an email to native-client-discuss+unsubscri...@googlegroups.com.
To post to this group, send email to native-cli...@googlegroups.com.

Nick Bray

unread,
Aug 27, 2013, 6:30:09 PM8/27/13
to native-cli...@googlegroups.com
Sorry about the lag getting back, I had to dig deep to figure out what was going on.

As it turns out, AudioInput is currently not available in NaCl.  It was added for PPAPI Flash, but it was not hooked up for NaCl because the functionality needed to prompt the user for access to the microphone, etc, has not been implemented.  (Flash does that internally, whereas NaCl would need to hook into the browser, similar to how fullscreen and mouselock work.)

The bottom line is that you are correctly set up to use a dev interface, it just happens this particular dev interface isn't available.  OK, that's rather unfortunate, how do you tell which dev interfaces are available?  You can't tell from the header files, which is rather annoying.  The best way I could find to answer the question is experimentation - request all the interfaces and see if they're available.  Attached is source for a module that probes all the interfaces in pepper_30 and prints the results to the JavaScript console.  If it's useful, I can pretty up the output.

Here's the result:

PPB_Audio;1.0 1 probe_interfaces.html:1
PPB_AudioConfig;1.0 1 probe_interfaces.html:1
PPB_AudioConfig;1.1 1 probe_interfaces.html:1
PPB_AudioInput(Dev);0.2 0 probe_interfaces.html:1
PPB_AudioInput(Dev);0.3 0 probe_interfaces.html:1
PPB_AudioInput(Dev);0.4 0 probe_interfaces.html:1
PPB_Buffer(Dev);0.4 0 probe_interfaces.html:1
PPB_CharSet(Dev);0.4 0 probe_interfaces.html:1
PPB_Console;1.0 1 probe_interfaces.html:1
PPB_Core;1.0 1 probe_interfaces.html:1
PPB_Crypto(Dev);0.1 0 probe_interfaces.html:1
PPB_CursorControl(Dev);0.4 1 probe_interfaces.html:1
PPB_DeviceRef(Dev);0.1 0 probe_interfaces.html:1
PPB_Ext_Alarms(Dev);0.1 1 probe_interfaces.html:1
PPB_Ext_CrxFileSystem_Private;0.1 1 probe_interfaces.html:1
PPB_Ext_Events(Dev);0.1 0 probe_interfaces.html:1
PPB_Ext_Socket(Dev);0.1 1 probe_interfaces.html:1
PPB_Ext_Socket(Dev);0.2 1 probe_interfaces.html:1
PPB_FileChooser(Dev);0.5 1 probe_interfaces.html:1
PPB_FileChooser(Dev);0.6 1 probe_interfaces.html:1
PPB_FileIO;1.0 1 probe_interfaces.html:1
PPB_FileIO;1.1 1 probe_interfaces.html:1
PPB_FileIO_Private;0.1 1 probe_interfaces.html:1
PPB_FileRef;1.0 1 probe_interfaces.html:1
PPB_FileRef;1.1 1 probe_interfaces.html:1
PPB_FileRefPrivate;0.1 0 probe_interfaces.html:1
PPB_FileSystem;1.0 1 probe_interfaces.html:1
PPB_Find(Dev);0.3 0 probe_interfaces.html:1
PPB_Font(Dev);0.6 0 probe_interfaces.html:1
PPB_Fullscreen;1.0 1 probe_interfaces.html:1
PPB_GLESChromiumTextureMapping(Dev);0.1 0 probe_interfaces.html:1
PPB_Gamepad;1.0 1 probe_interfaces.html:1
PPB_Graphics2D(Dev);0.1 0 probe_interfaces.html:1
PPB_Graphics2D;1.0 1 probe_interfaces.html:1
PPB_Graphics2D;1.1 1 probe_interfaces.html:1
PPB_Graphics3D;1.0 1 probe_interfaces.html:1
PPB_HostResolver;1.0 1 probe_interfaces.html:1
PPB_HostResolver_Private;0.1 1 probe_interfaces.html:1
PPB_IMEInputEvent(Dev);0.1 0 probe_interfaces.html:1
PPB_IMEInputEvent(Dev);0.2 1 probe_interfaces.html:1
PPB_ImageData;1.0 1 probe_interfaces.html:1
PPB_InputEvent;1.0 1 probe_interfaces.html:1
PPB_Instance;1.0 1 probe_interfaces.html:1
PPB_KeyboardInputEvent(Dev);0.1 1 probe_interfaces.html:1
PPB_KeyboardInputEvent;1.0 1 probe_interfaces.html:1
PPB_Memory(Dev);0.1 1 probe_interfaces.html:1
PPB_MessageLoop;1.0 1 probe_interfaces.html:1
PPB_Messaging;1.0 1 probe_interfaces.html:1
PPB_MouseCursor;1.0 1 probe_interfaces.html:1
PPB_MouseInputEvent;1.0 1 probe_interfaces.html:1
PPB_MouseInputEvent;1.1 1 probe_interfaces.html:1
PPB_MouseLock;1.0 1 probe_interfaces.html:1
PPB_NetAddress;1.0 1 probe_interfaces.html:1
PPB_NetAddress_Private;0.1 1 probe_interfaces.html:1
PPB_NetAddress_Private;1.0 1 probe_interfaces.html:1
PPB_NetAddress_Private;1.1 1 probe_interfaces.html:1
PPB_NetworkProxy;1.0 1 probe_interfaces.html:1
PPB_OpenGLES2;1.0 1 probe_interfaces.html:1
PPB_OpenGLES2ChromiumEnableFeature;1.0 1 probe_interfaces.html:1
PPB_OpenGLES2ChromiumMapSub(Dev);1.0 1 probe_interfaces.html:1
PPB_OpenGLES2ChromiumMapSub;1.0 1 probe_interfaces.html:1
PPB_OpenGLES2FramebufferBlit;1.0 1 probe_interfaces.html:1
PPB_OpenGLES2FramebufferMultisample;1.0 1 probe_interfaces.html:1
PPB_OpenGLES2InstancedArrays;1.0 1 probe_interfaces.html:1
PPB_OpenGLES2Query;1.0 1 probe_interfaces.html:1
PPB_Printing(Dev);0.7 1 probe_interfaces.html:1
PPB_ResourceArray(Dev);0.1 1 probe_interfaces.html:1
PPB_Scrollbar(Dev);0.5 0 probe_interfaces.html:1
PPB_TCPServerSocket_Private;0.1 1 probe_interfaces.html:1
PPB_TCPServerSocket_Private;0.2 1 probe_interfaces.html:1
PPB_TCPSocket;1.0 1 probe_interfaces.html:1
PPB_TCPSocket_Private;0.3 1 probe_interfaces.html:1
PPB_TCPSocket_Private;0.4 1 probe_interfaces.html:1
PPB_TCPSocket_Private;0.5 1 probe_interfaces.html:1
PPB_Testing(Dev);0.7 0 probe_interfaces.html:1
PPB_Testing(Dev);0.8 0 probe_interfaces.html:1
PPB_Testing(Dev);0.9 0 probe_interfaces.html:1
PPB_Testing(Dev);0.91 0 probe_interfaces.html:1
PPB_Testing(Dev);0.92 1 probe_interfaces.html:1
PPB_TextInput(Dev);0.1 0 probe_interfaces.html:1
PPB_TextInput(Dev);0.2 1 probe_interfaces.html:1
PPB_TouchInputEvent;1.0 1 probe_interfaces.html:1
PPB_Trace_Event(Dev);0.1 1 probe_interfaces.html:1
PPB_Trace_Event(Dev);0.2 1 probe_interfaces.html:1
PPB_TrueTypeFont(Dev);0.1 1 probe_interfaces.html:1
PPB_UDPSocket;1.0 1 probe_interfaces.html:1
PPB_UDPSocket_Private;0.2 1 probe_interfaces.html:1
PPB_UDPSocket_Private;0.3 1 probe_interfaces.html:1
PPB_UDPSocket_Private;0.4 1 probe_interfaces.html:1
PPB_URLLoader;1.0 1 probe_interfaces.html:1
PPB_URLRequestInfo;1.0 1 probe_interfaces.html:1
PPB_URLResponseInfo;1.0 1 probe_interfaces.html:1
PPB_URLUtil(Dev);0.6 0 probe_interfaces.html:1
PPB_Var(Deprecated);0.3 0 probe_interfaces.html:1
PPB_VarArray;1.0 1 probe_interfaces.html:1
PPB_VarArrayBuffer;1.0 1 probe_interfaces.html:1
PPB_VarDictionary;1.0 1 probe_interfaces.html:1
PPB_VideoCapture(Dev);0.2 0 probe_interfaces.html:1
PPB_VideoCapture(Dev);0.3 0 probe_interfaces.html:1
PPB_VideoDecoder(Dev);0.16 0 probe_interfaces.html:1
PPB_View(Dev);0.1 1 probe_interfaces.html:1
PPB_View;1.0 1 probe_interfaces.html:1
PPB_View;1.1 1 probe_interfaces.html:1
PPB_WebSocket;1.0 1 probe_interfaces.html:1
PPB_WheelInputEvent;1.0 1 probe_interfaces.html:1
PPB_Widget(Dev);0.3 0 probe_interfaces.html:1
PPB_Widget(Dev);0.4 0 probe_interfaces.html:1
PPB_X509Certificate_Private;0.1 1 probe_interfaces.html:1
PPB_Zoom(Dev);0.2 0



To unsubscribe from this group and stop receiving emails from it, send an email to native-client-di...@googlegroups.com.
probe_interfaces.cc

Maciek D

unread,
Aug 29, 2013, 3:35:27 AM8/29/13
to native-cli...@googlegroups.com
Thanks for your help Nick.

Bill Budge

unread,
Aug 29, 2013, 6:23:18 PM8/29/13
to native-cli...@googlegroups.com
You can also tell by inspecting these PPAPI proxy files, which determine which APIs are proxied to NaCl:
src/ppapi/thunk/interfaces_ppb*
and especially
src/ppapi/thunk/interfaces_ppb_public_dev.h

Reply all
Reply to author
Forward
0 new messages