sebagari
|
2012-09-11
, 12:52
|
Posts: 40 |
Thanked: 4 times |
Joined on Mar 2012
|
#4311
|
|
2012-09-11
, 12:56
|
Posts: 33 |
Thanked: 37 times |
Joined on Jul 2012
|
#4312
|
What about this?
http://people.csail.mit.edu/hubert/pyaudio/
MIT License and seems to be pretty easy to record audio:
Code:""" Record a few seconds of audio and save to a WAVE file. """ import pyaudio import wave import sys chunk = 1024 FORMAT = pyaudio.paInt16 CHANNELS = 1 RATE = 44100 RECORD_SECONDS = 5 WAVE_OUTPUT_FILENAME = "output.wav" p = pyaudio.PyAudio() stream = p.open(format = FORMAT, channels = CHANNELS, rate = RATE, input = True, frames_per_buffer = chunk) print "* recording" all = [] for i in range(0, RATE / chunk * RECORD_SECONDS): data = stream.read(chunk) all.append(data) print "* done recording" stream.close() p.terminate() # write data to WAVE file data = ''.join(all) wf = wave.open(WAVE_OUTPUT_FILENAME, 'wb') wf.setnchannels(CHANNELS) wf.setsampwidth(p.get_sample_size(FORMAT)) wf.setframerate(RATE) wf.writeframes(data) wf.close()
|
2012-09-11
, 13:02
|
Posts: 65 |
Thanked: 26 times |
Joined on Mar 2012
@ Cagliari, Italy
|
#4313
|
|
2012-09-11
, 13:27
|
Posts: 190 |
Thanked: 206 times |
Joined on Jan 2010
@ Accra,Ghana
|
#4314
|
|
2012-09-11
, 13:32
|
|
Posts: 20 |
Thanked: 46 times |
Joined on Apr 2012
@ Austria
|
#4315
|
That not a bad start but i doubt you would want to send wave files. The audio should still be converted to mp3 or some other compressed format.
|
2012-09-11
, 13:41
|
Posts: 44 |
Thanked: 25 times |
Joined on Apr 2012
@ Argentina
|
#4316
|
The Following User Says Thank You to eennbb For This Useful Post: | ||
|
2012-09-11
, 13:42
|
Posts: 208 |
Thanked: 63 times |
Joined on May 2012
|
#4317
|
|
2012-09-11
, 14:53
|
Posts: 9 |
Thanked: 4 times |
Joined on Sep 2012
@ Malaysia
|
#4318
|
The Following User Says Thank You to RH87 For This Useful Post: | ||
|
2012-09-11
, 15:01
|
Posts: 37 |
Thanked: 7 times |
Joined on Aug 2012
|
#4319
|
|
2012-09-11
, 15:10
|
Posts: 55 |
Thanked: 5 times |
Joined on May 2012
|
#4320
|
Tags |
godoftool, harmattan, is-a-miracle, nokia n9, spacker_thread, tarekgalal, toddler_daycare, toolcoderus, wazapp, whatsapp |
|