[Etoys] [ENH]SoundLibraryCompress Re: Compressing sounds

Karl karl.ramberg at comhem.se
Wed Dec 5 09:16:13 EST 2007


"Change Set:        SoundLibraryCompress
Date:            5 December 2007
Author:            Karl Ramberg

Add a halo menu item that GSM compress and replace the selected sound "



This option was missing from the SoundLibraryTool.
Hope this works :-)

Karl

Luke Gorrie wrote:
> Howdy!
>
> I have a lot of big sampled speech (form .wav files -- MixedSound
> objects) in the SoundLibrary and I'd like to compress them with
> GSMCodec and still use them with 'make sound' tiles. Can someone
> please give me an incantation?
>
> I'm off to a school in the morning but I need to prune RAM usage
> somewhat first :-)
> _______________________________________________
> Etoys mailing list
> Etoys at lists.laptop.org
> http://lists.laptop.org/listinfo/etoys
>
>   

-------------- next part --------------
'From etoys2.3 of 3 December 2007 [latest update: #1820] on 5 December 2007 at 3:13:43 pm'!
"Change Set:		SoundLibraryCompress
Date:			5 December 2007
Author:			Karl Ramberg

Add a halo menu item that GSM compress and replace the selected sound "!


!SoundLibraryTool methodsFor: 'menu' stamp: 'kfr 12/5/2007 15:11'!
addCustomMenuItems: aMenu hand: aHand
	"Add custom menu items to a menu"

	super addCustomMenuItems: aMenu hand: aHand.
	aMenu addTranslatedList: #(
		('wave editor' edit 'open a tool which, operating with the selected sound as a point of departure, will allow you to construct a new "instrument"')
		('GSM compress sound' compress 'compress the sound with GSM compression and replace the uncompressed one')
	) translatedNoop! !

!SoundLibraryTool methodsFor: 'menu' stamp: 'kfr 12/5/2007 15:10'!
compress
	"Compress the sound."
| newSound name writer |
soundIndex > 0
		ifTrue: [newSound _ GSMCodec new compressSound:currentSound .].
		writer := ByteArray new writeStream.
	 newSound channels
				do: [:channel | writer nextPutAll: channel].
	name := listBox getList at: soundIndex. 
	SampledSound removeSoundNamed: name.
	SampledSound addLibrarySoundNamed: name bytes: writer contents codecSignature: newSound codecSignature
	
! !



More information about the etoys-dev mailing list