©2003 Kåre Sjölander and Jonas Beskow
Introduction Download Documentation Links Forum
WaveSurfer user forum

FAQ  FAQ
Search  Search
Memberlist  Memberlist
Register  Register
Profile  Profile
Login  Login

snd.length(unit="SECONDS") buggy?

 
Post new topic   Reply to topic    www.speech.kth.se/wavesurfer Forum Index -> WaveSurfer
View previous topic :: View next topic  
Author Message
mickel



Joined: 17 Dec 2002
Posts: 28
Location: Espoo, Finland

PostPosted: Mon Nov 10, 2003 2:22 pm    Post subject: snd.length(unit="SECONDS") buggy? Reply with quote

Hi,

There seems to be a bug in the length() method of the tkSnack.Sound class. (I'm using Snack from Python). It should return a floating point value but it returns an integer, i.e. shortening the sound.

Here is my test code:

Code:
>>> snd1.info()
(7920, 24000, 19590, -23077, 'Lin16', 1, 'AU', 28)
>>> snd1.length(unit="SAMPLES")
7920
>>> snd1.length(unit="SECONDS")
0
>>> ##Length in secs should be:
...
>>> float(snd1.info()[0])/snd1.info()[1]
0.33000000000000002


Am I right? Or have I misunderstood something?
Back to top
View users profile Send private message Visit posters website
kare



Joined: 16 Aug 2002
Posts: 371
Location: KTH, Centre for Speech Technology

PostPosted: Mon Nov 10, 2003 4:59 pm    Post subject: Reply with quote

Very strange, similar code works for me.

I tried the lines below from the directory snack2.2.2/python/ of the source dist

from Tkinter import *
from tkSnack import *
root = Tkinter.Tk()
initializeSnack(root)
s = Sound(load='../demos/python/ex1.wav')
s.length(unit="SECONDS")

which gives

0.98875

What do you get?

Kåre
Back to top
View users profile Send private message Visit posters website
mickel



Joined: 17 Dec 2002
Posts: 28
Location: Espoo, Finland

PostPosted: Tue Nov 11, 2003 3:18 pm    Post subject: Reply with quote

Code:
>>> from Tkinter import *
>>> from tkSnack import *
>>> root = Tkinter.Tk()
>>> initializeSnack(root)
>>> s = Sound(load="downloads/snack2.2/demos/python/ex1.wav")
>>> s.length(unit="SECONDS")
0
>>>


Strange indeed.

I am using Python 2.3.2 and Snack 2.2.3 on Redhat Linux 9.

/Mickel
Back to top
View users profile Send private message Visit posters website
Geoffrey



Joined: 03 Feb 2003
Posts: 32
Location: Belgium

PostPosted: Wed Nov 12, 2003 9:41 am    Post subject: Reply with quote

It works also for me.

Geoffrey
Back to top
View users profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    www.speech.kth.se/wavesurfer Forum Index -> WaveSurfer All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You can post new topics in this forum
You can reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB 2.0.1 © 2001, 2002 phpBB Group