Archived:How to record a sound in PySymbian
This snippet shows how to record audio in Python.
Valid file formats must be used. Their availability may vary from one device generation to another and they tipically include WAV, AMR, MP3, AAC, RA.
import e32, audio
#Open a sound file at the given path
s = audio.Sound.open(u"C:\\sound.amr")
#Instantiate a timer
t = e32.Ao_timer()
#Record for 10 seconds, then stop
Sound is recorded to an audio file at the specified path.
Issue with Nokia 6600: Apparently files recorded in WAV format cannot be played. It seems Nokia 6600 has the problem with uncompressed 16-bit wave but it can play other wave files fine.