AudioChatGUI question

squeak-dev at lists.squeakfoundation.org squeak-dev at lists.squeakfoundation.org
Wed Oct 16 16:39:56 UTC 2002


Hello,

    My name is Peter Gadzinski and I'm relatively new to Squeak. I've been having fun tinkering with the AudioChatGUI morph. 

    I've noticed though that when audio messages are received and played the playback speed is about 40% faster then the recorded speed. I came to this value by sending audio messages that counted off 20 seconds: 1, 2, .., 20 
counted off using a clock. On the receiving end the message plays back in most cases around 14 seconds. I browsed through the AudioChatGUI code and noticed I could control the samplingRate of the sender and receiver. Currently I think they are kept in synch using the EToyPeerToPeer class. 

    I tried to knock them out of synch by making the receiver play at a slower samplingRate. I did this by modifying the send method of AudioChatGUI. The result was that the receiver played the message at a similar speed, but lower in frequency (deeper sound). Below is my modified send method.

send

	| null rawSound aSampledSound playbackSamplingRate |

	mytargetip isEmpty ifTrue: [
		^self inform: 'You must connect with someone first.'.
	].
	rawSound _ myrecorder recorder recordedSound ifNil: [^self].
	aSampledSound _ rawSound asSampledSound.
"Smalltalk at: #Q3 put: {rawSound. rawSound asSampledSound. aCompressedSound}."
	self transmitWhileRecording ifTrue: [
		self sendOneOfMany: rawSound asSampledSound.
		queueForMultipleSends ifNotNil: [queueForMultipleSends nextPut: nil].
		queueForMultipleSends _ nil.
		^self
	].

"Adjustment of playback samplingRate"
playbackSamplingRate _ '1000'.
playbackSamplingRate _ (((playbackSamplingRate) asInteger) printString).

	null _ String with: 0 asCharacter.
	EToyPeerToPeer new 
		sendSomeData: {
			EToyIncomingMessage typeAudioChat,null. 
			Preferences defaultAuthorName,null.
              playbackSamplingRate,null.
			"aSampledSound originalSamplingRate asInteger printString,null."
			(mycodec compressSound: aSampledSound) channels first.
		}
		to: mytargetip
		for: self.

    Does anyone have any suggestions on how I can get the right sound speed. 

Peter Gadzinski
----- Get your free WebMail account from Sympatico-Lycos at www.sympatico.ca -----




More information about the Squeak-dev mailing list