472,958 Members | 1,785 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,958 software developers and data experts.

Edit Audio Using Python?

Hello Python Gurus,
I picked up a book the other day on Python programming. Python rocks!
I'm learning Python as I want to call upon it to handle some intensive
tasks from PHP/web server.

The top goal right now is automating audio editing using Python. Is it
possible? I was able to do this directly through php, but it was
reaaaallllyyyyy slowwwwwwww. PHP is not designed for that sort of
thing.

So far I googled the Snack Sound Toolkit at http://www.speech.kth.se/snack/
.. It seems to have potential, but is very limited, and has not been a
very active project lately from what I can tell. I'm not sure I can
use it without learning C or C++ to make it do what I want (fading
ends, appending - there but not working?, mixing). It may work once I
learn more about it.

Do you know of any other modules, scripts, or whatnot that allows for
fast .wav audio editing from a Python script (not through a visual
interface)? Would it be better to start from scratch?

Thank you much for the advise :)

Jun 20 '07 #1
4 6485
Ah! I found this on the official website:
http://www.python.org/doc/1.5.2p2/li...e-audioop.html

That should keep me occupied. If you think of anything interesting
however, I would be happy to know. :)

Jun 20 '07 #2
On Jun 20, 12:21 pm, Ultrus <ownthe...@gmail.comwrote:
Ah! I found this on the official website:http://www.python.org/doc/1.5.2p2/li...e-audioop.html

That should keep me occupied. If you think of anything interesting
however, I would be happy to know. :)
I think you'll find that you have to put a lot of pieces together
to manipulate audio -- it's all there, but it's not straightforward.

I did it in my "skimpygimpy" audio components, which may help
(especially
if you ignore the stranger parts where I went off the deep end).

Start by looking at the "waveTools.toneFile()" method, which, I think,
writes out a wave file containing "concert A".

http://skimpygimpy.sourceforge.net -- follow link to downloads...

-- Aaron Watters

===
an apple every 8 hours
will keep 3 doctors away. -- kliban

Jun 20 '07 #3
Aaron,
Thanks for sharing this!
I think you'll find that you have to put a lot of pieces together
to manipulate audio -- it's all there, but it's not straightforward.
The challenge of building something unique makes it more worth while.
I did it in my "skimpygimpy" audio components, which may help
(especially
if you ignore the stranger parts where I went off the deep end).
Sweet program. I wish I had access to it on websites where I can never
seem to read the captcha letters.

The waveTools are VERY helpful! My biggest wall was getting samples
from audio files. Your scripts go beyond that. I'll play with the
scripts once I know a bit more on Python, and send you an update if I
expand upon it.

Thank you

Jun 21 '07 #4
Thanks to Aaron, I was able to read and write audio data using
Python's wave module. Trying to better understand the data I'm looking
at, what does each element of the frame represent, and how do I
convert a sample ranging from -32,768 to 32,768 back to a frame set
like below?

When using a 16 bit mono wav file, reading a frame of audio produces 2
numbers like this:

import wave
file = wave.open("myWave.wav")
frame = file.readframes(1) #read first frame
file.close
#ord(frame[0]) = 0 to 256, ord(frame[1]) = 0 to 256,
#possible max of 65,536, or sample with range of -32,768 to 32,768
Jun 29 '07 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: MiLF | last post by:
Is it possible to write a Audio CD Player by using python only?
2
by: Bruce Bon | last post by:
The class below is intended to play a Sun audio file (.au) in the background while the main thread, which is servicing a GUI, continues without impact. It doesn't work. For a sound file that...
1
by: Noah | last post by:
I need to record raw 8-bit mono audio from a generic sound card on MS-Windows. I need to do something like this: sound_device = open audio device buffer = sound_device.read ('1 second, 8 bit,...
24
by: Dave Benjamin | last post by:
Guido gave a good, long interview, available at IT Conversations, as was recently announced by Dr. Dobb's Python-URL! The audio clips are available here: ...
1
by: Ron Provost | last post by:
Hello, I'm developing a piece of software to assist illiteraate adults to learn to read. I'm trying to figure out how, if possible, to make audio playback asynchrnous but still controllable. ...
0
by: apa7hy.spam | last post by:
this message was originally posted by someone else and closed without a proper answer. i'm reposting it in hopes that someone will provide a solution. Begin Quote: "I'm attempting to play...
2
by: andrea valle | last post by:
Dear all, I have created a large Python-based GUI project and I'd like to use it as a GUI interface for real time audio sequencing (using the SuperCollider -SC- synthesis server). Python (the...
2
by: Pan Xingzhi | last post by:
Guys: Hi there. Recently I'll have to write a quite interesting program in Python on a Linux box. What I need is a function which allows the user to 'switch' the audio output from <an audio...
5
by: skip | last post by:
(I asked this on pythonmac-sig a couple days ago but got no response, so I'm casting a broader net.) Can I easily control audio record/playback from Python on my Mac? I know zip about audio...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
by: DJRhino | last post by:
Was curious if anyone else was having this same issue or not.... I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
0
by: Aliciasmith | last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
0
tracyyun
by: tracyyun | last post by:
Hello everyone, I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
3
by: nia12 | last post by:
Hi there, I am very new to Access so apologies if any of this is obvious/not clear. I am creating a data collection tool for health care employees to complete. It consists of a number of...
0
isladogs
by: isladogs | last post by:
The next online meeting of the Access Europe User Group will be on Wednesday 6 Dec 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, Mike...
2
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.