×
Namespaces

Variants
Actions

Archived:How to record and play sound in m

From Nokia Developer Wiki
Jump to: navigation, search

Archived.pngArchived: This article is archived because it is not considered relevant for third-party developers creating commercial solutions today. If you think this article is still relevant, let us know by adding the template {{ReviewForRemovalFromArchive|user=~~~~|write your reason here}}.

M on Symbian is not maintained and may not run on current Symbian versions. All M articles have been archived.

Article Metadata
Tested with
Devices(s): Nokia N95, Nokia E90
Compatibility
Platform(s): S60 2nd Edition, S60 3rd Edition, S60 5th Edition
Symbian
S60 5th Edition
Platform Security
Capabilities: )
Article
Created: bogdan.galiceanu (05 May 2009)
Last edited: hamishwillee (09 May 2013)

Contents

Overview

This article shows how to record and play sound in m.

Preconditions

Note: The play and open functions require the Read permission.

Source code

Recording sound

use audio
 
 
//Open a file for recording
audio.open("C:\\sound.wav", audio.rw)
//Start recording
audio.record()
//Record for 10 seconds and then stop
sleep(10000)
audio.stop()
//Cut 2000 milliseconds from the file at the beginning and end
audio.cut(2000, 2000)
//Show its current duration
print "The file is now " + audio.len() + " milliseconds long"
//Close the audio file
audio.close()

Playing a tone

use audio
 
 
//Play a tone with a frequency of 850 hz for 1000 milliseconds
audio.beep(850, 1000)

Playing a sound file

use audio
 
 
//Set the volume to 80% of the maximum
audio.volume(80)
//Start playing
audio.play("C:\\sound.wav")
//Play for 10 seconds and then stop
sleep(10000)
audio.stop()
//Close the audio file
audio.close()

Postconditions

Sound is recorded or played.

This page was last modified on 9 May 2013, at 05:50.
49 page views in the last 30 days.

Was this page helpful?

Your feedback about this content is important. Let us know what you think.

 

Thank you!

We appreciate your feedback.

×