©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

How do I change the sound in a Wsurf widget?

 
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: Fri Sep 26, 2003 7:39 am    Post subject: How do I change the sound in a Wsurf widget? Reply with quote

How do I change the sound in an existing Wsurf widget (from Python)? I tried configuring sound to a new Snack sound object, but it doesn't seem to work.

If ws is the Wsurf widget already holding some signal, then this is what I would like to do:

Code:
newsound = tkSnack,Sound(file="newsignal.wav")
ws.config(sound=newsound)

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



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

PostPosted: Fri Sep 26, 2003 8:17 am    Post subject: Reply with quote

Actually, it works as it should, except that the waveforms etc, are not updated in real time. I.e. when I change the sound in a wsurf widget, the timeaxis and wavebar changes, but the waveforms, spectrograms etc. are not updated directly. I came up with a way to go around this (delete the waveform pane and add a new one instead), but that is really an ugly solution. So any ideas on how I can force the waveforms etc. to get redrawn when the sound changes? (It must be possible as the little waveform in the wavebar is redrawn when the sound changes.)

Cheers.

/Mickel
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: Wed Oct 01, 2003 11:05 am    Post subject: Reply with quote

Try adding these lines to analysis.plug at line 1429 (or somewhere inside if {$v(drawWaveform)... )

set c [$pane canvas]
$c itemconfigure waveform -sound $s
$c itemconfigure spectrogram -sound $s


Now if you first configure the sound object which the wsurf widget should use and then add the panes you want everything should work as desired.

I'll have to make sure the above lines are ok under all other circumstances also...

Kåre
Back to top
View users profile Send private message Visit posters website
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