I'm trying to use the Speech C# SDK with Blazor, but even in the simplest of examples I always get NoMatch.
var result = await recognizer.RecognizeOnceAsync();
switch (result.Reason) // <-- Here I get ResultReason.NoMatch
any help would be greatly appreciated.
Geo
The method for RecognizeOnceAsync uses the default system microphone and mine was bad, when I set my default microphone to the correct one in Windows 10, the SDK started working as intended.
Related
I have the following very basic TTS code running on my local server
using System.Speech.Synthesis;
...
SpeechSynthesizer reader = new SpeechSynthesizer();
reader.Speak("This is a test");
This code has a dependency on System.Speech for which I have added a Reference in my VS 2015 project.
Works fine but from what I have read and from trying it I know this will not work when the code is hosted on Azure.
I have read several posts on SO querying if it is actually possible to do TTS on azure. Certainly 2 yrs ago it did not appear to be possible. How to get System.Speech on windows azure websites?
All roads seem to lead to the Microsoft Speech API
https://azure.microsoft.com/en-gb/marketplace/partners/speechapis/speechapis/
I have signed up and have gotten my private and sec keys for calling into this API.
However my question is this. How do I actually call the SpeechAPI? What do I have to change in the simple code example above so that this will work when running on azure?
The speech API you referred to at the Azure marketplace is part of an AI Microsoft project called ProjectOxford which offers an array of APIs for computer vision, speech and language.
These are all RESTful APIs, meaning that you will be constructing HTTP requests to send to a hosted online service in the cloud.
The speech-to-text documentation is available here and you can find sample code for various clients on github. Specifically for C# you can see some code in this sample project.
Please note that ProjectOxford is still in preview (Beta). Additional support for using these APIs can be found on the ProjectOxford MSDN forum.
But just to give you an idea of how your program will look like (taken from the above code sample on github):
AccessTokenInfo token;
// Note: Sign up at http://www.projectoxford.ai for the client credentials.
Authentication auth = new Authentication("Your ClientId goes here", "Your Client Secret goes here");
...
token = auth.GetAccessToken();
...
string requestUri = "https://speech.platform.bing.com/synthesize";
var cortana = new Synthesize(new Synthesize.InputOptions()
{
RequestUri = new Uri(requestUri),
// Text to be spoken.
Text = "Hi, how are you doing?",
VoiceType = Gender.Female,
// Refer to the documentation for complete list of supported locales.
Locale = "en-US",
// You can also customize the output voice. Refer to the documentation to view the different
// voices that the TTS service can output.
VoiceName = "Microsoft Server Speech Text to Speech Voice (en-US, ZiraRUS)",
// Service can return audio in different output format.
OutputFormat = AudioOutputFormat.Riff16Khz16BitMonoPcm,
AuthorizationToken = "Bearer " + token.access_token,
});
cortana.OnAudioAvailable += PlayAudio;
cortana.OnError += ErrorHandler;
cortana.Speak(CancellationToken.None).Wait();
I'm trying to use this MediaCapture API sample:
https://code.msdn.microsoft.com/windowsapps/Media-Capture-Sample-adf87622
but when I press Start Record to record to a file, this line never returns:
await m_mediaCaptureMgr.StartRecordToStorageFileAsync(recordProfile, m_recordStorageFile);
And no error is thrown. This computer is a Cyberpower PC. The sample DOES work on my other windows 10 computer (a mac mini) though. I thought maybe it was a codec issue but can't find any information on installing codecs so maybe that is not it--not sure. Thank you for any help or information.
Additional Info: Creating a profile like this works:
MediaEncodingProfile recordProfile = null;
recordProfile = MediaEncodingProfile.CreateWmv(Windows.Media.MediaProperties.VideoEncodingQuality.Auto);
But calling CreateMp4 instead of CreateWmv does not work.
My suspicion is that there's something wrong with your particular installation's encoders. If you can upgrade to Windows 10, with Visual Studio 2015 you can develop universal apps. The same code should work without an issue.
I'm writing Universal app (WinStore 8.1 + WinPhone 8.1). For my requirements I need to retrieve all device contacts. It's OK on WinPhone - here is code how I do that:
var contactStore = await ContactManager.RequestStoreAsync();
var contacts = await contactStore.FindContactsAsync();
But how to do that in WinStore app?
It is not possible by design I am afraid.
Tt's not possible to get the information from the people app. It works within calendar, mail or messenger because they're all technically contained within the same app and are able to use each other's data and violate normal rules.
You can always use the ContactPicker.
This might help.
Windows Phone 8 gives the ability to change the default camera app with another one downloaded from the store, making this new app the one that's launched when you hit the camera hardware button.
So I was wondering if is there any chance to launch this app using the CameraCaptureTask.
What I'd like to do is something simple like
var camera = new CameraCaptureTask();
camera.Show();
camera.Completed += new EventHandler<PhotoResult>(camera_Completed);
but I want this to work with the default app that the user chose on its device, and not with the basic Microsoft's one.
I've not found anything online, so I'm asking to you guys if I can make what I want.
Sorry, not possible with the current API.
i'm developing software to display ip camera "Acti", i tried to use axnvUnifiedControl but i cannot find any information about it.
my goal is to connect to the camera using IP, username, and password and display the camera image in windows form.
i'm using c# .net 4.0
This can be done using the following code snippet:
First you should reference the OCX in your toolbox, and drag it to your form. but i tried to use it in design mode, but the VS is hang and force close.
camMedia.MediaSource = CameraIP;
camMedia.MediaUsername = UserName;
camMedia.MediaPassword = Password;
camMedia.HttpPort = HttpPort;//80
camMedia.RegisterPort = RegisterPort;//6000
camMedia.ControlPort = ControlPort;//6001
camMedia.StreamingPort = StreamingPort;//6002
camMedia.Connect(0);
where the camMedia is the OCX object name.
ACTi has quite a wide range of cameras, and they do not share uniform API. You have to look for documentation for your model of interest and check the vendor's sample code and SDKs. The cameras also have some support for well known protocols, such as RTSP and M-JPEG over HTTP so you can leverage certain libraries to visualize the feed, but again you will need documentation, specification and SDKs to find out the essential information.