You are not logged in.

#1 2013-10-17 01:13:47

lagagnon
Member
From: an Island in the Pacific...
Registered: 2009-12-10
Posts: 1,087
Website

Python: simple sound ideas?

I am a newbie to Python, but did some very minor Tcl/Tk and Fortran programming in the deep dark past. The little project I have to learn the language is a morse code practice program.

I want to try and be really efficient with the sound generation function as I want this program to produce good very high speed morse code. Initially I thought to keep things simple I would just use the Unix "beep" software and Python's os.system module. But that means the function and the OS software are called and run for every single little morse sound, it may not be fast enough at really high speed, but I haven't really tested this yet. Also, I notice that "beep" throws an error unless I'm root as it won't give access to /dev to a normal user.

My idea is to create a temporary stored sound byte in the system at the right frequency and then have a very simple output to /dev or whatever and bascailly play that sound byte each time for the right duration to get the code. I would think that might be more efficient.

Still mulling it over - any ideas?


Philosophy is looking for a black cat in a dark room. Metaphysics is looking for a black cat in a dark room that isn't there. Religion is looking for a black cat in a dark room that isn't there and shouting "I found it!". Science is looking for a black cat in a dark room with a flashlight.

Offline

#2 2013-10-17 06:12:32

ngoonee
Forum Fellow
From: Between Thailand and Singapore
Registered: 2009-03-17
Posts: 7,358

Re: Python: simple sound ideas?

Personal project? Why directly access /dev when you could use abstraction?


Allan-Volunteer on the (topic being discussed) mailn lists. You never get the people who matters attention on the forums.
jasonwryan-Installing Arch is a measure of your literacy. Maintaining Arch is a measure of your diligence. Contributing to Arch is a measure of your competence.
Griemak-Bleeding edge, not bleeding flat. Edge denotes falls will occur from time to time. Bring your own parachute.

Offline

Board footer

Powered by FluxBB