Unable to reuse a Player to handle another sound...

Visuals, audio, animation. Blended, not stirred. If LiveCode is part of your rich media production toolbox, this is the forum for you.

Moderators: FourthWorld, heatherlaine, Klaus, kevinmiller, robinmiller

Post Reply
astroboy
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 30
Joined: Wed Apr 09, 2008 8:05 pm

Unable to reuse a Player to handle another sound...

Post by astroboy » Wed Apr 16, 2008 7:03 pm

Hi there!

In Revolution 2.9, you can reproduce what seems to be a bug, following these steps:

1. Assign a sound file to a player. Play the sound with "start player" or whatever.

2. After the sound is finished, assign another sound file to the same player. Play the sound.

Alas! the sound is not the most recently assigned, it's the first one!

I also tried to change the sound of the player using script "set the filename of player..." but no luck. The player always plays the first assigned sound, no matter what filename it has set.

I'm using the Linux version. Is this also happening in other OSes?

Thanks in advance.

Klaus
Posts: 14177
Joined: Sat Apr 08, 2006 8:41 am
Contact:

Post by Klaus » Wed Apr 16, 2008 8:07 pm

Hi astroboy,

try this, which worked for me in the past:

...
set the filename of player XYZ to empty
wait 2 millisecs
set the filename of player XYZ to "Your new file here..."
...

At least worth a try :-)


Best

Klaus

astroboy
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 30
Joined: Wed Apr 09, 2008 8:05 pm

Post by astroboy » Wed Apr 16, 2008 11:58 pm

Nope. That didn't work...

Drachen Jager
Posts: 20
Joined: Tue Aug 28, 2007 9:23 pm

Same problem here

Post by Drachen Jager » Thu Apr 24, 2008 10:53 pm

Klaus's fix doesn't work for me either (windows xp 64)

Also, I notice that sometimes I can get the sound to change but I'm not really sure why it does it sometimes and not others.

The "Property Inspector" of the player shows the correct (changed) filename even when the player is playing the old file.

This is completely new to 2.9, older versions work fine.


AUGH! Revolution programmers! I paid money for your fixes and I was hoping to be publishing soon now that you fixed your previous bugs with audio only now I find it's STILL too buggy for me to publish my project. Would you get your act together!

Drachen Jager
Posts: 20
Joined: Tue Aug 28, 2007 9:23 pm

Post by Drachen Jager » Thu Apr 24, 2008 11:06 pm

I just realized why it was working for me sometimes. If the command to switch audio files is executed BY the player (for example as an "on Stopped") it seems to switch correctly, needs more testing but it appears to work OK.

Still it's going to be a pain in the butt to reprogram everything with that as a workaround.

astroboy
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 30
Joined: Wed Apr 09, 2008 8:05 pm

Post by astroboy » Fri Apr 25, 2008 3:44 pm

Hi Drachen

I hadn't been able to test successfully your workaround here (RunRev 2.9 Linux). I put "set the filename of player..." as a script in the player (onStopped, even as on playstopped), and the filename changes, but it is still playing the first assigned sound...

The ugly workaround I did is... to create a player for EVERY sound in the app... Yep, that means 140 players for this particular app... :x

Drachen Jager
Posts: 20
Joined: Tue Aug 28, 2007 9:23 pm

Ha!

Post by Drachen Jager » Wed May 21, 2008 9:52 pm

140 sounds! I wish I only had 140... I'd have to work it out but I think I'm more like 1,400.

In other words, not realistic.

Mark
Livecode Opensource Backer
Livecode Opensource Backer
Posts: 5150
Joined: Thu Feb 23, 2006 9:24 pm
Contact:

Post by Mark » Thu May 22, 2008 8:23 am

Hi DJ,

You can play a file without loading it into Revolution, but I can imagine that large sound files play with some delay.

play <path to soundfile>

Best,

Mark
The biggest LiveCode group on Facebook: https://www.facebook.com/groups/livecode.developers
The book "Programming LiveCode for the Real Beginner"! Get it here! http://tinyurl.com/book-livecode

Post Reply