| Reply | « Previous Thread | Next Thread » |
|
I got a script to record unlimited audio in my N80 and it works for WAV and AMR.But for MP4, the recording isn't perfect: when i try to play the recorded file, it's played very very fast.I had the same problem with 6681, but for WAV recordings when saved to MMC.Is there some way to slow down the recording speed?Below is the script (it was not created by me)
Code:
#audio recorder app
import appuifw
import e32
import audio
print" "
# define filename
name = appuifw.query(u'Type file name', "text")
extension = appuifw.query(u"File type(wav/amr/mp4)", "text")
#Full path of the file
filename = 'e:\\sounds\\digital\\'+name+"."+extension
# record (extension should be supported by the device):
def recording():
global S
# open the sound file to be ready for recording and set an instance (S) of it
S=audio.Sound.open(filename)
# do the recording (has to be stopped by closing() function below)
S.record()
print "Recording "+filename+" ... Press Options-Stop to finish"
# define the playing part:
def playing():
global S
try:
# open the sound file to be ready for playing by setting an instance (S) of it
S=audio.Sound.open(filename)
# play the sound file
S.play()
print "Playing"
except:
appuifw.note(u"A song must be recorded first", "error")
# stopping of recording / playing and closing of the sound file
def closing():
global S
S.stop()
S.close()
appuifw.note(u"Stopped", "conf")
print u""
print u"Stopped"
def exit_key_handler():
script_lock.signal()
appuifw.app.set_exit()
script_lock = e32.Ao_lock()
appuifw.app.title = u"audio recorder"
#menu
appuifw.app.menu = [(u"record audio", recording),
(u"play latest", playing),
(u"stop", closing)]
appuifw.app.exit_key_handler = exit_key_handler
script_lock.wait()
|
|
i've uploaded a example of the audio recorded by the given script.It's found here.It's a normal song that was recorded, but due to a unknown reason, the speed is increased by 4 times or more during playback.Does someone have an idea of what's happening?
If at least there was a way to slow down the recording...Cause i suppose it's a bug in the audio module Thanks
Last edited by alb3530 : 2007-02-06 at 15:53.
|
|
Hi,
It sounds like the sample rate is not set correctly in the file. It is set to 44.1kHz and it is almost certainly a lot less than that. It's quite likely that the sample rate of the PCM recorded from the device is not being correctly specified to the encoder. I don't think there's anyway you can fix this in your script but I really don't know much about Python. Sorcery |
| Sorcery-ltd |
| View Public Profile |
| Find all posts by Sorcery-ltd |
|
Quote:
As you said, i think it's not possible to revert the situation by editing the script only. A pity, i thought i could finally be able to record only audio in MP4 rather than having to record a MP4 video and send the file to someone that have a pc, asking the person to edit the video and extract audio only. Not even current C++ apps can record audio in MP4, i think.At least i don't know of any Thanks for your reply |
|
Quote:
It seems that class "CMdaAudioRecorderUtility" (used internally in PyS60 extension "audio") has methods "GetSupportedSampleRates" and "SetDestinationSampleRateL()" which you could perhaps use to solve your problem. A patch for this would be also nice. |
|
Quote:
Code:
audio.SetDestinationSampleRateL(16000) I'm afraid i can't do that, for i'm totally newbie in python scripting language...I mean, it should be effective only when user chooses MP4 recording.AMR, for example, would have a less sample rate. Well, then i did a bad thing by reporting the problem related in this topic as being a bug at sourceforge... I look forward for your advice. |
|
Quote:
So you have to change source code with SetDestinationSampleRateL (c++ function L as LEAVE and not PyS60 function !) Cyke64 pys60 1.4.5,1.9.7,pygame,PyS60 CE on E90 , N810 with Python 2.5.2 and ... last PyS60 1.9.7 with touch ui on 5800 ! pys60 extension modules on http://cyke64.googlepages.com/ |
|
Quote:
Thanks for your reply |
| Reply | « Previous Thread | Next Thread » |
| Thread Tools | Search this Thread |
|---|---|
| Rate This Thread | |
| Thread | Thread Starter | Forum | Replies | Last Post |
|---|---|---|---|---|
| Audio input streaming problem on Series 60 v2.6 phones (6680,6630) | andrew.hayes | Symbian Media (Graphics & Sounds) | 1 | 2006-01-20 15:30 |
| Common problem: wrong file format "exception" | lukaszpl | Mobile Java General | 0 | 2005-12-05 18:09 |
| Bluetooth Python Standalone APP problem | wallace_nogueira | Python | 0 | 2005-05-03 20:25 |
| audio capture from microphone in gsm format | venable | Mobile Java Media (Graphics & Sounds) | 1 | 2004-01-07 12:10 |
| 3650 audio recording in GSM 6.10 format | tctse | General Symbian C++ | 4 | 2003-06-20 10:25 |