canislupus
02-22-2010, 09:00 AM
Hi All,
I am trying to convert recorded voice prompts to binary. Reason I am doing this is to test 3rd party voice recognition platform.
They are providing web service for this purpose and I need to send recorded voice prompt in binary format.
On my side user prompts same phrase 3 times and I will collect these prompts, convert them to binary and send to web service of voice recognition platform.
Here is a sample aspx code:
<script runat="server">
/************************ returnText *******************/
string returnText()
{
string[] Texts = new string[]
{
"my voice my password",
"my voice my password",
"my voice my password"
};
return Texts;
}
byte returnWavs()
{
byte[][] Wavs = new byte[][]
{
File.ReadAllBytes("C:\temp\200994_0hr_39sec_562.wav"),
File.ReadAllBytes("C:\temp\200994_0hr_39sec_562.wav"),
File.ReadAllBytes("C:\temp\200994_0hr_39sec_562.wav")
};
return Wavs;
}
</script>
What I need to do is, I should convert this to a .js. As I'm new to js, any feedback will be appreciated.
P.S: new string[] is to store prompt in text format, so that 3rd party voice recognition platform will compare the text and recorded prompt.
Thanks,
I am trying to convert recorded voice prompts to binary. Reason I am doing this is to test 3rd party voice recognition platform.
They are providing web service for this purpose and I need to send recorded voice prompt in binary format.
On my side user prompts same phrase 3 times and I will collect these prompts, convert them to binary and send to web service of voice recognition platform.
Here is a sample aspx code:
<script runat="server">
/************************ returnText *******************/
string returnText()
{
string[] Texts = new string[]
{
"my voice my password",
"my voice my password",
"my voice my password"
};
return Texts;
}
byte returnWavs()
{
byte[][] Wavs = new byte[][]
{
File.ReadAllBytes("C:\temp\200994_0hr_39sec_562.wav"),
File.ReadAllBytes("C:\temp\200994_0hr_39sec_562.wav"),
File.ReadAllBytes("C:\temp\200994_0hr_39sec_562.wav")
};
return Wavs;
}
</script>
What I need to do is, I should convert this to a .js. As I'm new to js, any feedback will be appreciated.
P.S: new string[] is to store prompt in text format, so that 3rd party voice recognition platform will compare the text and recorded prompt.
Thanks,