473,385 Members | 1,930 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

AIFC (Python and audio files.)

Hello, Python Wizards...

I'm trying to use Python to write an aiff file. I've used the aifc module
and I've set the parameters (# of channels, encoding rate, compression,
etc.)

What does raw audio data look like? Is each word of the raw audio data a
frequency? If I encode 440 for each of the frames, will I get concert A?

Thanks for any advice you can give on this subject.

Best,

-k

--
Kelvin Chu
Department of Physics, Cook Building, 82 University Place
University of Vermont, Burlington, VT 05405-0125
802.656.0064, http://www.uvm.edu/~kchu/
Jul 18 '05 #1
3 2468
Kelvin Chu wrote:

Hello, Python Wizards...

I'm trying to use Python to write an aiff file. I've used the aifc module
and I've set the parameters (# of channels, encoding rate, compression,
etc.)

What does raw audio data look like? Is each word of the raw audio data a
frequency? If I encode 440 for each of the frames, will I get concert A?


AIFC files contain digitally sampled sound, much like the data
stored on a CDROM.

Try looking up PCM (Pulse Code Modulation) on Google for a deeper
explanation.

Erik
--
+-----------------------------------------------------------+
Erik de Castro Lopo no****@mega-nerd.com (Yes it's valid)
+-----------------------------------------------------------+
The word "Windows" is a word out of an old dialect of the
Apaches. It means: "White man staring through glass-screen
onto an hourglass..."
Jul 18 '05 #2
Kelvin Chu fed this fish to the penguins on Sunday 13 July 2003 06:34
pm:

What does raw audio data look like? Is each word of the raw audio
data a
frequency? If I encode 440 for each of the frames, will I get concert
A?
So far as I know, aiff is raw waveforms... IE: each data point varies
from -127(8) to +127 (well, actually I think they may use 16bit data
rather than 8bit, you should understand the concept). To get one second
of pure A you will have to encode a sine wave (-1.0..+1.0) scaled to
(-127..+127) into one second's worth of data. Figure out the
samples/second, and work out the relationship to the frequency of the
A...

Of course, you do have the options of using other wave forms -- a sine
wave is rather pure... Maybe you want a square wave?

One of the earliest "synthesizers" I had was a D/A converter on my
TRS-80 Mod III/4 (Orchestra 90, as I recall). The software defined
instruments in terms of relative strengths of harmonics -- a sine wave
was something like F0000000 (full level on primary, 0 on all harmonics).

-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Bestiaria Home Page: http://www.beastie.dm.net/ <
Home Page: http://www.dm.net/~wulfraed/ <


Jul 18 '05 #3
Dennis Lee Bieber fed this fish to the penguins on Sunday 13 July 2003
08:52 pm:

So far as I know, aiff is raw waveforms... IE: each data point
Whoops, misread your subject... Not sure what aifc differences might
be...

-- ================================================== ============ <
wl*****@ix.netcom.com | Wulfraed Dennis Lee Bieber KD6MOG <
wu******@dm.net | Bestiaria Support Staff <
================================================== ============ <
Bestiaria Home Page: http://www.beastie.dm.net/ <
Home Page: http://www.dm.net/~wulfraed/ <


Jul 18 '05 #4

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

Similar topics

0
by: sj | last post by:
Im trying to read sample values from aiff files but can not seem to get the unpacking right. Ths following code reads n frames from a sample file and prints the amplitudes to the terminal. In the...
8
by: fuliopen | last post by:
I like to create some audio files for my web site. These are all language files to help the visitor learn a foreign language. There is no music. As far as I know, I can create three types of...
2
by: James Harris | last post by:
Hi, I am wanting to develop some software that a) Reads existing files of music of a few well known types b) Displays the music in traditional notation - i.e. on a stave c) Displays the same...
19
by: Levi Campbell | last post by:
Hi, I'm thinking about writing a system for DJing in python, but I'm not sure if Python is fast enough to handle the realtime audio needed for DJing, could a guru shed some light on this subject...
4
by: Gary Morrison | last post by:
I need to create a lot of fairly-short audio files from the concatenation of a lot of even shorter audio files. I'd like to control that from a Perl script. The audio files would presumably be...
2
by: hzgt9b | last post by:
Using VS2003, VB.NET, BACKGROUND I have a window forms based application that will be distributed and executed directly from CD media. The app contains a TreeView control and a WebBroswer...
13
by: anil.rita | last post by:
When the user chooses an AV file to play, based upon the type of file, I want to use the default installed media player to play it. I am wondering if this is a good way - any alternatives,...
7
by: gheissenberger | last post by:
HELP! Guy who was here before me wrote a script to parse files in Python. Includes line: print u where u is a line from a file we are parsing. However, we have started recieving data from...
4
by: Ultrus | last post by:
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...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

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.