LinuxQuestions.org
Latest LQ Deal: Latest LQ Deals
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.

Notices


Reply
  Search this Thread
Old 07-11-2011, 02:52 PM   #1
ITPhoenix
Member
 
Registered: Mar 2011
Location: Northeast USA
Distribution: Debian Squeeze
Posts: 47

Rep: Reputation: 1
Python "support" included in C program


Newb programmer would like to know what this means. I have pocketsphinx installed with a bunch of .py files.

I am just asking how this works in general. I know Python can wrap a C code, but here it seems Python is already integrated with this C program.

Would it be correct to say one would have to understand the C code in addition to py programming in order to accomplish anything useful here?

I need to control the program, and especially import its output to some algorithm that accomplishes command and control in the way of bash scripts or whatever.

I am not asking for programming lessons, just a pointer or two.

Thanks.
 
Old 07-11-2011, 05:38 PM   #2
Nominal Animal
Senior Member
 
Registered: Dec 2010
Location: Finland
Distribution: Xubuntu, CentOS, LFS
Posts: 1,723
Blog Entries: 3

Rep: Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948Reputation: 948
PocketSphinx is not a program, it is a speech recognition library written in C. It has language bindings for Python, which means you can use the library from Python programs too; to Python programs, the library looks like a normal Python library.

You don't really need to know C to use PocketSphinx, if you know Python. The example program in the tutorial is written in C, but there is an example on how to use PocketSphinx as a GStreamer component with the user interface written in Python.

I don't think you have to use GStreamer to use PocketSphinx from Python programs, it just makes things easier. Without GStreamer, you'd probably have to use ALSA or some audio library to read the raw audio samples, and feed them to the library yourself. Nothing too complicated, but I'd still recommend checking out the PocketSphinx-GStreamer-Python stuff first.
 
Old 07-11-2011, 07:17 PM   #3
ITPhoenix
Member
 
Registered: Mar 2011
Location: Northeast USA
Distribution: Debian Squeeze
Posts: 47

Original Poster
Rep: Reputation: 1
Thanks. I had perused the Gstreamer/Python tutorial a while ago when I knew zero. Now I have a better understanding as to what is going on.

I have dreams of writing a full ISR program using the Sphinx4 recognizer (written in Java) in a robotics application with the goal of passing the Total Turing Test.

Until then, it appears I should pursue the easier route with pocketsphinx and the above tutorial to get some practical programming experience. But time is limited so I would prefer to start with what I will be ending up with. In other words, countless hours would be spent with Gstreamer and Python when the time could be spent learning Java. According to the tutorials, Sphinx4 is a better candidate for the high goal mentioned above. For example, configuration files can be modified on the fly, .i.e, while it is running.

KDE's command and control project died a few years ago along with a few others. It seems distro and hardware compatibility are major issues, not to mention if tts is to be integrated as well. Moreover, audio in Linux is neither easy nor fun. This is frustrating and encouraged me to take on the task.

I thank for your input. You have been very helpful.
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Program to "assemble" still-frame pictures into "animated" show Pantherman Linux - General 3 12-24-2009 11:14 PM
LXer: Ubun-student is renamed to "Ailurus"-New PPA repositories included- LXer Syndicated Linux News 0 12-11-2009 06:00 PM
[SOLVED] Why isn't "Auto Mobile Connection" included with all Linux distros? catilley1092 Linux - Hardware 2 09-25-2009 12:11 AM
Is there any tar equivalent library function which can be included in a "C" code bagav General 1 09-13-2006 01:16 PM
User "list" running process "python" TroelsSmit Linux - Newbie 2 02-22-2005 04:55 AM

LinuxQuestions.org > Forums > Non-*NIX Forums > Programming

All times are GMT -5. The time now is 07:24 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration