Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sound playback stuttering

Status
Not open for further replies.

solari

Programmer
Apr 19, 2001
4
YU
I have problems with the background music in my Director movie. When I use Lingo to switch (text, image and flash) members of on-screen sprites, the background WAV (loop) gets interrupted for about half a second or less, depending on the size of the members. This happened on several different PCs I tested, but not on all (faster machines work better).

I tried to solve this by calling updateStage from the event handler, tried to "preloadMember" all members before the beginning of the movie, but to no avail... It looks as if too much Lingo in an event handler stops the sound from playing... Is there a solution to this problem other than reducing the Lingo code?
 
Never had this happen before.
How is the sound set to loop? how do you start the sound playing? ie with code or is in in the timeline? I personally wont use the timeline for audio, so if you are using the timeline try this code where you want the audio to start

puppetsound 1, soundmembername




 
Yes, the sound is started with puppetSound in the prepareFrame event of frame 1. The movie is a web browser-like app, using Lingo to show HTML members depending on the hyperlink clicked. I have two text (HTML) sprites, two image/flash sprites, and a couple of small ones (one line) for back/forward etc links. When the user clicks on a link, they all get changed - via Lingo and in a single (hyperlinkClicked) event. Now, when there is a switch to large members, the playback simply pauses in a single frame - it looks as if the member switch is slowing it down - and after that there is a break in the sound. My guess is that the sound playback depends on the playback head entering new frames regularly... It sounds silly, but with Director you never know :) The docs say something about sound buffers, but only for preloading SWA... (I think I'll try that anyway.)

In the meantime, I discovered that breaking the members' change into distinct frames solves the problem (they have to be two or three frames apart, though), but I'm not satisfied with this, there has to be an intelligent solution. Do you have any idea?
 
Yeah well,

All of what has been written is all valid and seems as if it will or has helped the person in question, but what size is the wav file and what bit rate has it been recorded in?
I find that most people have shitty little speakers and you can get away with having 8 bit mono sound which decreases the wav size quite alot and in doing so reduces the stuttering of the sound.
Is this an option in your prodcution? if it is only background music?

Hope this is some help.

Mazdarx7s1sav
 
Thanks!

You may be right. I did decrease the sound quality (22 kHz 16-bit mono - it amounts to some 3 MB), but I suppose I should go even further. If I have to choose between poor quality and stuttering, I think I'll go for poor quality.

Still, this is quite a strange behavior for the kind of multimedia application the Director is. At least sound playback is a simple matter, given DirectSound etc, it should make no problems. I'm starting to think I'll have to write my own Xtra to override Lingo and use DirectSound directly (of course, it won't work on a Mac, but luckily this isn't an issue)...
 
Thanks!

You may be right. I did decrease the sound quality (22 kHz 16-bit mono - it amounts to some 3 MB), but I suppose I should go even further. If I have to choose between poor quality and stuttering, I think I'll go for poor quality.

Still, this is quite a strange behavior for the kind of multimedia application the Director is. At least sound playback is a simple matter, given DirectSound etc, it should make no problems. I'm starting to think I'll have to write my own Xtra to override Lingo and use DirectSound directly (of course, it won't work on a Mac, but luckily this isn't an issue)...
 
If you are using Director 8, the puppetSound command is obsolete. It's better to use the new sound Lingo. You can preload the sounds and then use the new commands to play them.

You queue up the sounds before they play with the command:
sound(channelNumber).queue(member "member name")

then you can play the file like this:
sound(channelNumber).play()

Hopefully this will avoid the stuttering.

I hope this helps.

Jody Lepinot
Prairie Studio
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top