Showing posts with label cross-platform-software. Show all posts
Showing posts with label cross-platform-software. Show all posts

Wednesday, April 12, 2017

Interesting programming links of the week

By Vasudev Ram


I've been seeing a good number of interesting posts about programming topics lately, on various forums, particularly HN, so I thought of sharing them here (both for my readers and for myself to look up again later). Here are some selected posts or threads that I think are interesting to programmers:

Electron is flash for the desktop (2016) (josephg.com)

Web Development in Go (inburke.com)

Ask HN: Will Rust ever become a mainstream systems programming language?

Computer Programming Using GNU Smalltalk (2009) (canol.info)

Ask HN: What would you use to make cross-platform desktop application?

The reference D compiler is now open source (dlang.org)

The Power of Prolog (metalevel.at)

I also commented on some of the threads.

Enjoy.

- Vasudev Ram - Online Python training and consulting

Get updates (via Gumroad) on my forthcoming apps and content.

Jump to posts: Python * DLang * xtopdf

Subscribe to my blog by email

My ActiveState Code recipes

Follow me on: LinkedIn * Twitter

Are you a blogger with some traffic? Get Convertkit:

Email marketing for professional bloggers



Saturday, March 1, 2014

Speech synthesis in Python with pyttsx

By Vasudev Ram

[ Click on the link below to hear a synthesized voice:
]

pyttsx is a library for cross-platform speech synthesis (a.k.a. text-to-speech) in Python. I saw it via this article on Dr. Dobbs Journal:

Voice Throwing with Python and Android.

I have an interest in speech synthesis and have tried out some tools for it in the past.

So I downloaded and installed pyttsx, and then tried it out a bit. Had to tweak the speech rate a bit, since the default "voice" was talking a bit too fast. Also, although going by its API, pyttsx seems to support more than one voice (if your underlying text-to-speech API supports that), the program only played the words in one voice (that of a woman), even though I ran it in a loop for all the voices. It could be that my OS doesn't support more than one voice, or maybe I need to use some other pyttsx option.

Here is the test program using pyttsx, test_pyttsx.py:
import pyttsx
engine = pyttsx.init()
engine.setProperty('rate', 70)

voices = engine.getProperty('voices')
for voice in voices:
    print "Using voice:", repr(voice)
    engine.setProperty('voice', voice.id)
    engine.say("Hi there, how's you ?")
    engine.say("A B C D E F G H I J K L M")
    engine.say("N O P Q R S T U V W X Y Z")
    engine.say("0 1 2 3 4 5 6 7 8 9")
    engine.say("Sunday Monday Tuesday Wednesday Thursday Friday Saturday")
    engine.say("Violet Indigo Blue Green Yellow Orange Red")
    engine.say("Apple Banana Cherry Date Guava")
engine.runAndWait()

You can run it with the command:
python test_pyttsx.py



- Vasudev Ram - Dancing Bison Enterprises

Contact Page



Monday, October 22, 2012

Kivy: cross-platform Python GUI toolkit (desktop and mobile)

Dusty's Diverse Domain » Blog Archive » Python on Android? First impressions of Kivy

Kivy has been in the tech news recently.

The article about it above is interesting. Though it only talks about mobile, the Kivy site, http://kivy.org, says that it works on desktops too - Linux, Windows and Mac OS X.

- Vasudev Ram

Thursday, October 13, 2011

PyAudio and PortAudio - like ODBC for sound

By Vasudev Ram - dancingbison.com | @vasudevram | jugad2.blogspot.com

PyAudio and PortAudio are I/O libraries for sound (i.e. audio).

I'm stretching the analogy a bit here, but they made me think:

"... like ODBC for sound". (*)

PyAudio is a Python interface to PortAudio.

PyAudio:

http://people.csail.mit.edu/hubert/pyaudio/

Excerpt:

[ PyAudio provides Python bindings for PortAudio, the cross-platform audio I/O library. With PyAudio, you can easily use Python to play and record audio on a variety of platforms. ]

PortAudio:

http://www.portaudio.com/

PortAudio apps:

http://www.portaudio.com/apps.html

I installed PyAudio for Windows. Installation was trivial. It also automatically installed the PortAudio DLL (actually, the .pyd file).

I then tried a PyAudio Python program from the docs to play a small .WAV file. It worked.

(*) That's because PyAudio and PortAudio support both:

a) different platforms (Windows, Linux, Mac, UNIX)

b) different "Host APIs" on the same platform, where the different Host API's have, obviously, different API's, but PortAudio (and hence PyAudio) hide those differences behind a uniform interface (to some extent).


UPDATE: If you interested in checking out other Python multimedia libraries, you may also like to read this earlier post of mine about pyglet:

Playing an MP3 with pyglet and Python is easy

pyglet has some of the same benefits as PyAudio - cross-platform, easy to use, etc.

Posted via email

- Vasudev Ram @ Dancing Bison