This is a read-only archive of the old Scratch 1.x Forums.
Try searching the current Scratch discussion forums.

#1 2007-12-10 20:29:12

murkle
Scratcher
Registered: 2007-11-19
Posts: 4

Stuttering/fluttering audio

Hi I'm having trouble with wav files imported into Scratch.

I hear fluttering/stuttering which sounds as if there's some sample rate conversion going crazy. However I've chosen compress samples from the menu and theoretically all samples should be at same sample rate.

Using latest scratch the same problem is apparent

Offline

 

#2 2007-12-10 21:34:31

murkle
Scratcher
Registered: 2007-11-19
Posts: 4

Re: Stuttering/fluttering audio

and another thing,
audio files in scratch play at a higher volume than any other app I use.
Samples that sound fine in an editor, break up when playing in scratch.

Offline

 

#3 2007-12-12 18:35:32

johnadmin
Scratch Team
Registered: 2007-03-13
Posts: 100+

Re: Stuttering/fluttering audio

Hi, Murkle.

I'm sorry you're having problems.

I'd be happy to investigate this issue if you can upload a project that has one of these imported sounds that does not play well. When you upload it, be sure to uncheck the box that says "compress sounds and images". Then post the URL for the project here.

For the volume issue, you can try using the new "set volume to" block to turn down the sound level in Scratch.

  -- John

Offline

 

#4 2007-12-12 19:46:33

murkle
Scratcher
Registered: 2007-11-19
Posts: 4

Re: Stuttering/fluttering audio

Hi John,

Thanks for the reply.

Here's a link to a project containing just the soundfile http://scratch.mit.edu/projects/murkle/66257

When taz say's 'flattery' and 'Get ya' I hear distortion in my speakers. :-(
The file plays correctly in 4 other wav editors.

I'm using a Delta 44 sound card, with latest drivers.

I will make up a project that has the fluttering issue I speak of in a day or two, I've uni work holding me up.

Offline

 

#5 2007-12-13 10:28:37

johnm
Scratcher
Registered: 2007-03-08
Posts: 100+

Re: Stuttering/fluttering audio

Hi, Murkle.

The peaks of that sound do get close to the limit, but don't go over it. So if you adjust your computer volume or use the Scratch volume block to reduce the level, it should not distort (a.k.a. "clip"). I'm not sure why the other sound editors are not playing the sound as loudly, but perhaps they have their own volume levels and they are not set to maximum. By default, the Scratch volume level is set to 100% (maximum).

You can use the right-shift menu on the sound to export it, then play the exported sound in one of your wave editors. Let me know if the exported sound seems louder than the original sound in your wave editor.

But I also notice that the sampling rate is 11025. That low sampling rate also contributes to a rough sound. Was the original sound sampled at that rate? Versions of Scratch before 1.2 had a "compress sounds" option that just reduced the sampling rate. It could be that you had applied that to an earlier version of this project. If you still have the original sound file, you might try re-importing it into Scratch 1.2.1. The new sound compression does not work by reducing the sampling rate, although Scratch does reduce sampling rates over 30k by half to save space. So if you sound is sampled at 44k (CD rate) then Scratch will reduce it to 22050, which still sounds very good.

I hope this helps.

  -- John

Offline

 

#6 2007-12-14 05:52:10

murkle
Scratcher
Registered: 2007-11-19
Posts: 4

Re: Stuttering/fluttering audio

The source files were 11KHz, couldn't be helped. I'm not sure that the other wav editors all have their volume reduced somehow, but maybe they deal with clipping samples differently. But then you say there's no clipping when you play it? I'm confused by that. Unless I reduce the volume of that sample outside scratch it sounds terrible.

When I export the sample and load into soundforge I see the meters go to -0.1db certainly that's pretty close, so perhaps soundforge is just limiting the samples to save my speakers?

With my sound card the volume is always 100%. It's up to the individual app to reduce the volume. Soundforge does not reduce the volume, however it could be limiting the peaks.

best,

Last edited by murkle (2007-12-14 05:54:13)

Offline

 

#7 2007-12-16 22:43:34

johnm
Scratcher
Registered: 2007-03-08
Posts: 100+

Re: Stuttering/fluttering audio

Hi, Murkle.

What I think is happening is that your system volume is high enough that it is actually adding some gain to the sound. So, even though Scratch is playing the sound at 100%, the system is boosting that by another few percent--enough to create that harsh sound that you report. (The harsh sound arises when the sound peaks try to go beyond the maximum sound level that can be represented with a 16-bit number, which is 32,767. But the system limits the digital sound signal to the value 32,767. The result, if you looked at it as a graph, would show that the highest peaks of your smooth sound wave had been leveled off, giving them flat tops. That effect is called clipping. All sound systems clip when they are over-driven, but with digital sound the clipping is very abrubt, which creates that extremely unpleasant distortion.)

I think that perhaps your wave editor programs may be bypassing the system sound setting, thus avoiding this problem. Or, as you say, SoundForge may be doing some intelligent volume adjustment to save your speakers.

As you discovered, turning down the sound level outside of Scratch makes the problem go away. Using the Scratch "set volume to" command should have the same effect: try "set volume to 50%" and then go up or down from there.

I am using a Mac and I don't get clipping when I play the sound in Scratch at the system volume level that I usually use. Also, I searched for the maximum sample value and it was below 32,767. If Scratch has introduced clipping when it imported the sound then the sound would contain many samples with the value 32,767.

This particular sound seems unusually "hot" (recorded at a high level). You observed that it has peaks of -0.1 db, which is consistent with the peak sample values I observed. Since you have SoundForge available, you could try reducing the level in SoundForge, exporting the quieter version, and importing that into Scratch. A quieter version of the sound might balance better with other sounds you are using.

It doesn't appear that there is a bug in Scratch related to the sound level.

What about the stuttering problem you mentioned? Could you upload or point me to a project that illustrates that problem?

  -- John

Offline

 

#8 2012-03-17 08:38:36

Fed9812
Scratcher
Registered: 2009-12-23
Posts: 1

Re: Stuttering/fluttering audio

Hey, I have that a similar problem with sounds, too. Sometimes when I try and open a sound from incompetech.com, (an MP3 format sound.) it sometimes makes no sound, in the preveiw when you click on it, or on the actual sound when imported. Other times, it makes a creepy scratching sound (NOT the right sound!) and when imported, either makes that same sounds with rumbling similar to that of a LAWN MOWER. Otherwise, it says in the headline thingy: Fatal VM error. In the inside it says: Sorry, but the VM has crashed. Exception code: (Different for each one) Exception address: (Also different) Current byte code: 162 (???) Primitive index: (?!) 117

This information will be stored in the file C:\Program Files (x86)\Scratch\crash.dmp (It never really is-which is just plain annoying) with a complete stack dump.


Hope you can fix it!

Offline

 

#9 2013-02-19 17:55:29

TravisDaCoolOne
New Scratcher
Registered: 2013-01-28
Posts: 5

Re: Stuttering/fluttering audio

Re-starting Scratch may fix this problem. It fixes the problem when I get it!

Offline

 

#10 2013-02-19 18:28:42

northmeister
Scratcher
Registered: 2011-07-12
Posts: 1000+

Re: Stuttering/fluttering audio

Don't necropost please


http://i48.tinypic.com/5a25g5.png

Offline

 

Board footer