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

#1 2010-03-08 16:00:56

SimpleScratch
Scratcher
Registered: 2007-05-25
Posts: 100+

Accessing speaker loudness

In this project ...
http://scratch.mit.edu/projects/SimpleScratch/921551
(Simply plays a sound and then loops doing fisheye effect changes on a copy sprite of the mouth region)

...it would be very nice to access the current value of the speaker output to modify the mouth movement instead of just using random numbers.

Is there anyway to do this in either Scratch or BYOB (or by a quick source code hack)?

regards
Simon

Last edited by SimpleScratch (2010-03-08 16:01:30)

Offline

 

#2 2010-03-08 17:36:13

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: Accessing speaker loudness

Hi Simon,

I've done a little hack that reports the midi note value of the microphone input, but not the output volume of the speaker. However, having looked at your project, two  ideas come to mind:

(1) you could specifically set the volume for certain passages (cumbersome to do), and then access it again by the volume reporter block (I just checked, and it seems to work)

(2) the loudness reporter block appears to do alright for me (but only offline, of course). That is, you could play the sound over the speakers and "sense" its loudness over a microphone (or the the PicoBoard), throw in a factor of some sort and there you are.

Any source code hack would also only ever work offline, I guess...


Jens Mönig

Offline

 

#3 2010-03-08 17:38:49

JSO
Community Moderator
Registered: 2007-06-23
Posts: 1000+

Re: Accessing speaker loudness

Maybe you can just select "Stereo Out" or "Wave Mix" as your sound input device in Windows - I've used it several times already to 'loop back' my speaker output to the loudness block in Scratch  smile

http://www.scratch.mit.edu/ext/youtube/?v=e5qa-HODWbc
http://www.scratch.mit.edu/ext/youtube/?v=tiW4lj5ZUNc

Last edited by JSO (2010-03-08 17:42:10)


http://oi48.tinypic.com/2v1q0e9.jpg

Offline

 

#4 2010-03-08 19:01:23

Jens
Scratcher
Registered: 2007-06-04
Posts: 1000+

Re: Accessing speaker loudness

Oh, that's a very good point, JSO. Thanks!


Jens Mönig

Offline

 

#5 2010-03-11 16:42:58

SimpleScratch
Scratcher
Registered: 2007-05-25
Posts: 100+

Re: Accessing speaker loudness

StereoMix is not a bad workaround  smile

I'm basically try to use Scratch as a free version of CrazyTalk (and then use Camstudio to capture the resulting output to an avi) so that should work.

It does on my home machine - I'll have to check to see if the school netbooks will do it as well

Ta again

Simon

Offline

 

Board footer