Looks like the Great Firewall or something like it is preventing you from completely loading www.skritter.com because it is hosted on Google App Engine, which is periodically blocked. Try instead our mirror:

legacy.skritter.cn

This might also be caused by an internet filter, such as SafeEyes. If you have such a filter installed, try adding appspot.com to the list of allowed domains.

faint sounds after pronunciation plays

jcardenio   May 12th, 2009 12:47p.m.

Congrats on the launch, a great program that has been really helpful. One quick comment, I'm not sure if this is happening for anyone else, but after the main pronunciation plays for a given character, after a second or two I hear three or four other words pronounced faintly in the background.

Kind of a cool effect though, makes me feel like I am hearing mandarin speaking ghosts.

jcardenio   May 12th, 2009 12:52p.m.

I should have included this before. It isn't with all the tones but a few examples:

怎, 作, 明, 时

Xerxes314   May 12th, 2009 1:32p.m.

Yes, I hear them too. It doesn't happen when you replay the sound, but only the first time after the word loads.

Xerxes314   May 12th, 2009 1:43p.m.

Other notes: It only happens after the first character in a word. It's not the same sound each time, even for the same character and word. Sometimes it doesn't happen at all; sometimes multiple syllables happen at once. It got a lot worse after the update a few minutes ago.

jannegbg   May 12th, 2009 1:46p.m.

I also heard it today. I've never heard it before.

ximeng   May 12th, 2009 1:56p.m.

Me too, it's quite distracting.

Élie   May 12th, 2009 2:39p.m.

Yeah, I've heard it a few times before, but I thought it was just my mind playing tricks on me.

Tortue   May 12th, 2009 3:10p.m.

Same here, My computer is speaking mandarin alone !

nick   May 12th, 2009 3:55p.m.

Sorry. I have exorcised the ghosts.

ximeng   May 12th, 2009 6:01p.m.

lol

Hobbes828   May 13th, 2009 12:29a.m.

haha yeah mine was doing that too, along with a bug (feature?) where it now sometimes/often reads the sound twice instead of just once, especially after I choose the tone (as opposed to when the tone is already included as part of the prompt).

Could be something on my computers end.. but I don't think I changed anything (although I did switch to firefox 3.5, i'll check later and get back on whether that is it).

nick   May 13th, 2009 3:17p.m.

Our internet just came back after a tech came by, although it now looks like the problem isn't fixed 'cause it's gone down again. Anyway, I've uploaded the ChinesePod sounds, sans ghosts and hopefully sans repetition.

nick   May 14th, 2009 2:38p.m.

Here's why this happened.

Each sound that might be needed is loaded as soon as a word is loaded for review (which is up to 4 prompts in advance). The character-level sounds are loaded from Skritter, the word-level sounds (if any) from ChinesePod.

We trimmed the character sounds to remove silence from either end, but we couldn't do that with the ChinesePod sounds. And now we need to play the word sound, then the first character sound, or the last character sound, then the word sound, depending on the prompt. But they can't play at the same time or with big gaps between them, so we have to wait until one is done to play the next.

Okay, so we'll use the SoundChannel's SOUND_COMPLETE event, which fires when the sound is done playing. Except there's a bug which causes that to be off by up to two seconds, so never mind. We'll just use the length of the sound file, which is determined after it finishes loading. Oh, but there's quite a bit of silence on either end of those for the words, and it's inaccurate until fully loaded. So we'll make sure everything is preloaded before we can play it, or we'll get overlaps.

What about dynamically checking the sound to trim silence just-in-time, when we load it? Sounds crazy enough to work! So when each sound is loaded, we'll play it at 0 volume, check the waveform each frame, and determine when it passes certain silence thresholds to figure out when it really starts and ends. Then when we need to play the file, we'll start it at the determined offset and wait for its real length before playing the next one.

Except when we put the volume to 0, we get no waveform. Okay, let's hack it even more: 1% volume, that should be quiet enough. Apparently not! That's where the ghosts came in.

As it turns out, setting it any lower than 1% volume (even .999% volume) treats it as 0 volume and kills the waveform. But after further testing, I can set 5% of the left input to play in the left channel, 0% of the right input in the left channel, and 0% of left and right in the right channel, and that doesn't kill the waveform, while making it 20x quieter. Makes the thresholds a lot more sensitive, requiring further tuning, but it seems to work. Awesome!

Another Flash player bug causes delays of up to 2 seconds before playing sounds, seemingly at random. But this one is fixed by updating to the very latest Flash player version. So if sound timing is still off, try that.

It looks like I've still got a bug with repetition of word-level audio when you're not being prompted for the tone. I'll try to fix that tonight.

jpo   May 14th, 2009 4:06p.m.

Great story! Gives the rest of us some insight into the hoops you guys are jumping through to build this great site.

ZachH   May 14th, 2009 7:13p.m.

Why don't you ask Chinesepod if you can edit their sound files for them? and then remove all the silence (not manually).
Then you would both win!

nick   May 14th, 2009 9:13p.m.

All ChinesePod needs to do is run their stuff through a bulk audio converter like dBpoweramp Converter, then reupload it. It would take ten minutes. I don't think it's too important for their purposes, though.

I think this solution is fine, and it tickles my hacking sensibilities to have ghosts in the machine.

There's a bunch of this sort of stuff in Skritter, mostly put in by me. More of it is in the supporting tools, like the Chef. Scott tends to do more legit coding, while I tread the dark ways.

Our code is really good, though. Yeah!

jcardenio   May 15th, 2009 1:54p.m.

Wow, thanks for the story as jpo said! It's always fun to get a glimpse under the hood. I'm always amazed at how hard it can get to do seemingly simple things. I can't even imagine what went into the stroke recognition.

I kinda like the idea of their being ghosts still. Maybe if I listen really hard....

jpo   May 15th, 2009 3:09p.m.

I've been having odd audio problems for a long time (delays, skipping certain tones). I just noticed Nick's advice about updating to the latest Flash player. I did so, and the audio seems to be fine now - thanks for this tip, Nick.

If you're having audio problems, you can check your Flash version here: http://kb2.adobe.com/cps/155/tn_15507.html. My current version is WIN 10,0,22,87, and this is working great (previously I had 10,0,16,36 or something like that - it wasn't really that old, but it was still not working properly).

Adobe's Flash update page is here: http://get.adobe.com/flashplayer/

This forum is now read only. Please go to Skritter Discourse Forum instead to start a new conversation!