Namespaces
Variants
Actions
(Redirected from How to record a sound)

Archived:How to record a sound in PySymbian

Jump to: navigation, search
Archived.png
Aquivado: Este artigo foi arquivado, pois o conteúdo não é mais considerado relevante para se criar soluções comerciais atuais. Se você achar que este artigo ainda é importante, inclua o template {{ForArchiveReview|escreva a sua justificativa}}.

All PySymbian articles have been archived. PySymbian is no longer maintained by Nokia and is not guaranteed to work on more recent Symbian devices. It is not possible to submit apps to Nokia Store.
MultiMediaTile.png
Article Metadata

Tested with
Devices(s): Nokia N95, Nokia E90

Compatibility
Platform(s): S60 1st Edition, S60 2nd Edition, S60 3rd Edition

Article
Keywords: audio
Created: cyke64 (15 Mar 2007)
Last edited: hamishwillee (14 Jun 2013)

Contents

Overview

This snippet shows how to record audio in Python.

Preconditions

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.

Source code

import e32, audio
 
 
#Open a sound file at the given path
s = audio.Sound.open(u"C:\\sound.amr")
#Start recording
s.record()
#Instantiate a timer
t = e32.Ao_timer()
#Record for 10 seconds, then stop
t.after(10, lambda:s.stop())

Postconditions

Sound is recorded to an audio file at the specified path.

Known issue

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.

This page was last modified on 14 June 2013, at 08:10.
149 page views in the last 30 days.
Nokia Developer aims to help you create apps and publish them so you can connect with users around the world.

京ICP备05048969号  © Copyright Nokia 2013 All rights reserved