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, mono, 8 KHz')
process buffer

If possible I would also like to experiment with sampling the raw audio
in my own loop. For example, something like this:
open audio device
while 1:
read byte from audio device
process byte
(I realize that Python is probably not ideal for this sort of DSP, but
I figure that it should handle 8KHz mono with no problem).

Does anyone have any experience with recording sound using the WIN32 API?
Can you point me in the right direction?

The OSS stuff in Python looks ideal, but unfortunately that's
a UNIX only thing :-(

Any hints are appreciated.


Search Discussions

  • Kevin Dahlhausen at Jan 28, 2004 at 2:33 pm
    Any hints are appreciated.

    I've not messed with this myself yet, but I know of an app that does
    serious audio processing that had to go through some part of the
    direct-X library. That app is sampling at a lot higher rate -
    probably closer to the limits of pc sound cards.

    If there's not a direct python api for directx, no pun intended,
    there's a library that wraps any dll that should do the trick.

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
postedJan 27, '04 at 6:50p
activeJan 28, '04 at 2:33p

2 users in discussion

Kevin Dahlhausen: 1 post Noah: 1 post



site design / logo © 2022 Grokbase