header
ask question
Click here to ask Question Now Its free No registration required. Flash, Flex, Flash Media Server, ActionScript,Adobe Air. Most questions receive a response in an hour.
BobTheCoolGuy
Points:0
Posts:0

11/20/2010 9:23:55 AM

Title: Playing back sound recorded at 16khz


I'm using the Speex codex of flash to record sound, and it records it at 16 khz (no way to change that). Is there a way I can playback the sound using the sound object so it doesn't lost pitch? Right now I am doing this:



private function playRecorded(e:SampleDataEvent): void
	{
		if (!rec.bytesAvailable > 0)
		return;
		var length:int = 2730;
		for (var i:int = 0; i < length; i++)
		{
			var sample:Number = 0;
			if (rec.bytesAvailable > 0) sample = rec.readFloat();
			e.data.writeFloat(sample);
			e.data.writeFloat(sample);
			e.data.writeFloat(sample);
			e.data.writeFloat(sample);
			e.data.writeFloat(sample);
			e.data.writeFloat(sample);
		}
	
	}

But this makes the sound a little lower than it started at.




Post your Reply
Name  

Email

Type your Reply or Answer

Are you human? What is 2+2 



Members Login

Email  
Password
Forgot Password





This website focus on: Flash | Flex | FMS | RED5 | WOWZA | Flash Media Server | Adobe AIR | ActionScript,Flash Solutions | Flash Question | Flash Answers | Flash Developers | Flash Problem, Flash Help, Flash bugs, Flash workaround | Flash Blog | Flex Question Answers | Flash Forum | Flex Development | Actionscript development | Flash development | Adobe AIR development
Copyright © 2008 AskMeFlash.com. All rights reserved. Privacy Policy | Terms & Conditions