Yay python!

Feel free to chat about anything here.

Yay python!

Postby thantik » Fri Nov 20, 2009 8:46 pm

Finally got PySpeex to compile (damn thing hasn't been updated since python 2.2), and now it's having some issues.

I'm hoping to get it all working so I can use the .encode and .decode functions and create something similar to VC (or maybe just a python-derived interface), but man I feel like my head is about to explode. I have no *formal* education on this stuff, just going by what I can read/look up myself

I did however manage to get the Microsoft Windows SDK installed; which is part of what VC source needed to compile though. I haven't played with all that just yet either. Python is just so much cleaner, I've seen the VC code and I don't wanna deal with all the scaffolding of the C language ;)
Last edited by thantik on Sat Nov 28, 2009 4:52 pm, edited 1 time in total.
thantik
 
Posts: 209
Joined: Sun Aug 30, 2009 7:22 pm
Location: Right behind you!

Re: Stupid PySpeex...

Postby thantik » Fri Nov 20, 2009 9:22 pm

Damn - the more I look into it the more I find different pathways to go each and every stinking time.

I can use Python ctypes to access the compiled .dll directly, which speex provides, meaning I can pretty much drag/drop new binary dlls in as long as things don't change too much; so this seems the better way to go, but then it means I have to do all this weird defining and setting up the speex encoder and making my own encoding class...GAH!

On top of that...I'm using Windows FLP - and somehow, some way...it's missing the NULL driver, which is keeping me from compiling some things! gah!
thantik
 
Posts: 209
Joined: Sun Aug 30, 2009 7:22 pm
Location: Right behind you!

Re: Stupid PySpeex...

Postby thantik » Fri Nov 20, 2009 9:42 pm

Awesome, got the null driver setup, had to copy it from another computer running 7.

And now I can build my own dll and call it with ctypes, YES!! It's just a stupid multiplication function right now, but it means I can compile the speex library seperately for the different platforms, and bundle it with the executables...

I'm learning. Slowly but surely I'm learning. Hopefully this means in the next couple weeks...(go ahead, laugh), I'll be able to use the functions that the speex library provides along with PyAudio (a PortAudio module for python) and I'll practically be using all the same libraries VoiceChatter is using.

On top of that...
http://xoomer.virgilio.it/infinity77/main/freeware.html
Has a TON of custom wx controls like HyperTreeList and CustomTreeList that allow you to append ANY wx control to the end of it all...

Image

It'll probably be a good 2 damn years before I ever catch up to VC but it'll be worth it. (I have to refrain from looking at VC's code actually...because VC = GPL; and I plan on releasing mine under an MIT/BSD/Apache license or something similar.)

I remember someone wanting a daemonized client; so I think I'll try and pull that off first, then maybe add a GUI layer that communicates to the back end somehow. Sooooo many possibilities. O_o
thantik
 
Posts: 209
Joined: Sun Aug 30, 2009 7:22 pm
Location: Right behind you!

Re: Stupid PySpeex...

Postby Xplayer » Fri Nov 20, 2009 10:40 pm

Lol. Nice blog you got going on here.
Image
VC Project Manager
http://www.ml-rp.com
Modern Life Roleplay (San Andreas Multiplayer Community)
Xplayer
 
Posts: 25
Joined: Fri Nov 13, 2009 7:37 pm
Location: Richmond, VA

Re: Stupid PySpeex...

Postby thantik » Thu Nov 26, 2009 7:14 pm

YAY SPEEX!!!

I found someone who had already done all the speex coding in an SVN repo on google code who had marked their source as freely usable. I win! It's windows only but it gives me a good example of how to interact/setup interface with the library (so now I just gotta flesh it out to use the mac library if it's a mac, and linux library if it's linux...

And it lets me access the encode/decode functions perfectly; which means all I'll need to do is build a frontend for it ;)

I'm actually hoping to eventually be able to *talk* to a VoiceChatter server. I've still got a lot to learn but hopefully it means that once my python classes are over (I start on Dec 9th), I might be able to build something workable. Python is just sooooo much easier to work with code-wise; and since the speex encoding, and the sound drivers are still all in C, they should function with the same speed just fine but with the front-end able to be coded differently ;)
thantik
 
Posts: 209
Joined: Sun Aug 30, 2009 7:22 pm
Location: Right behind you!

Re: Stupid PySpeex...

Postby Xplayer » Thu Nov 26, 2009 8:32 pm

Interesting. :idea: You should teach me something lol.
Image
VC Project Manager
http://www.ml-rp.com
Modern Life Roleplay (San Andreas Multiplayer Community)
Xplayer
 
Posts: 25
Joined: Fri Nov 13, 2009 7:37 pm
Location: Richmond, VA

Re: Stupid PySpeex...

Postby thantik » Thu Nov 26, 2009 10:51 pm

I've actually got it to the point of sending sound from one computer to another. I now have a proper way to just send data to the encode/decode functions, I'm (for now) reading a .wav file from my computer (using a winamp example), sending it over UDP, and playing it on her computer; I'm so excited!

That same winamp example also has a nice little function in it which reads which key your pressing no matter what application your in, so at this point all I need to do is modify that function, tie the audio into PyAudio for my Mic; and I should have a rudimentary voice chat.

Unfortunately nobody (I mean NOBODY) has made any examples for me to follow to use libspeexdsp.dll or to be able to use echo cancellation, etc. So I gotta take this; (and what I've learned from it) to write an include for libspeexdsp as well. So far so good; this has actually given me some ideas for some other stuff as well ;)
thantik
 
Posts: 209
Joined: Sun Aug 30, 2009 7:22 pm
Location: Right behind you!

Re: Stupid PySpeex...

Postby thantik » Sat Nov 28, 2009 4:52 pm

wow, I'm starting to realize what ChrisW meant when he was saying that the audio was extremely sensitive to things. I've started noticing a lot of echo in the processing of sound, but I think I need libspeexdsp.dll to be able to echo-cancel. I still have to figure that out. Chris, if you see this; what do you know about the echo cancellation?

Overall though I'm freakin ECSTATIC over the fact that using python to send voice is now complete, I'm going to release a modified .py file for others to use along with examples sometime in the future. But I'm finding that I have to do a lot with PyAudio to make sure that the settings I'm using on the speex codec match what I'm inputting via the audio input...otherwise I get a lot of crazy things (primarily just a looping of noise)
thantik
 
Posts: 209
Joined: Sun Aug 30, 2009 7:22 pm
Location: Right behind you!

Re: Yay python!

Postby ChrisW » Mon Nov 30, 2009 12:59 pm

I know basically nothing about echo cancellation and decided that it wasn't worth the effort trying to figure out right now. So...good luck!
VoiceChatter Lead Developer/Founder
ChrisW
Site Admin
 
Posts: 424
Joined: Tue Aug 21, 2007 8:12 pm

Re: Yay python!

Postby thantik » Tue Dec 01, 2009 2:57 am

Yeah, I found a few echo cancellation algos but they get a little deep for me. I found out my echo was caused by having my headphones up too high, and my mic was really sensitive.

Either way I figured out that I didn't really need echo cancellation because I wouldn't be playing back what I was saying, into my own ear. I tested the theory and voila...nice crisp recording.

Are you doing any de-noising? And where do you pull off the volume normalization? What about the individual user volumes thing that you mentioned, could you give me any breakdown of that (I'd really like to somehow set this so the mic isn't as sensitive)?
thantik
 
Posts: 209
Joined: Sun Aug 30, 2009 7:22 pm
Location: Right behind you!

Re: Yay python!

Postby ChrisW » Tue Dec 01, 2009 6:26 pm

The normalization is part of the speex encoder, and the per-client volume control is done when mixing all of the audio together to be sent to the sound card. VC doesn't do any extra denoising beyond what speex does by default.
VoiceChatter Lead Developer/Founder
ChrisW
Site Admin
 
Posts: 424
Joined: Tue Aug 21, 2007 8:12 pm

Re: Yay python!

Postby iKarampa » Mon Mar 29, 2010 7:23 am

Hi,

Great work.I am working on a project which involves Speex. I tried the pySpeex with no luck, have you managed to create any packages for python 2.6 ?
iKarampa
 
Posts: 1
Joined: Mon Mar 29, 2010 7:19 am

Re: Yay python!

Postby thantik » Mon Mar 29, 2010 9:32 am

Actually, I ended up NOT using pySpeex because Pyrex is out-of-service. Cython can compile Pyrex stuff but it would require a bit of rework on my end in order to get it working. (And I don't know any C, or at least...not enough to fix it.)

I found some GPL code on Google Code, and threw it into a .py file so you can import it; but it requires the speex dlls to be in the same directory; It uses ctypes to access the DLLs directly. (Note: This *should* be cross platform if you add the logic for it and download/include the speex .so files for mac/linux and link to them if you are on that particular platform.)

https://docs.google.com/leaf?id=0ByxvvR ... NDIx&hl=en
That's the speex.py file;

https://docs.google.com/leaf?id=0ByxvvR ... MjVm&hl=en
And that is a sample file that records mic input, and simply repeats it back to you.

Hope this helps ;) -- One day I might try and port pySpeex 0.2 to Cython and recompile at that point but I don't have enough knowledge of the codec to know what's going on...I really wish I could get ChrisW interested in python, he'd knock it out in a single day =(
thantik
 
Posts: 209
Joined: Sun Aug 30, 2009 7:22 pm
Location: Right behind you!


Return to Off Topic

Who is online

Users browsing this forum: No registered users and 1 guest

cron