Skip to content

Commit

Permalink
Updated Native Ionic code folder (#20)
Browse files Browse the repository at this point in the history
* Added plugin and native ionic code

* Removed the cognitive services plugin .DS_Store file from gitignore, and added all .DS_Store files.

* Renamed Native Ionic Folder.  Updated Readme.

* Added images for README

* Renamed cognitiveservicesPlugin folder
  • Loading branch information
esgraham authored Jan 28, 2020
1 parent 66ae70c commit f29a90f
Show file tree
Hide file tree
Showing 52 changed files with 4,470 additions and 9 deletions.
10 changes: 5 additions & 5 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
.DS_Store
cogservPlugin/node_modules/
cogservPlugin/.gradle/
cogservPlugin/platforms/
cogservPlugin/src/ios/MicrosoftCognitiveServicesSpeech.framework/
cogservPlugin/aar
cognitiveservicesPlugin/node_modules/
cognitiveservicesPlugin/.gradle/
cognitiveservicesPlugin/platforms/
cognitiveservicesPlugin/src/ios/MicrosoftCognitiveServicesSpeech.framework/
cognitiveservicesPlugin/aar
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ Environments.ts file.
In the folder of the Ionic Application (ie examples/ionic-angular), run the following steps.

Run the following command to install all packages within the app. In a terminal
window, browse to the speecthtoText folder
window, browse to the examples/ionic-angular folder
and run the following:

```bash
Expand All @@ -94,7 +94,7 @@ npm i -g cordova
To include the wrapper for the Cognitive Services plugin as an observable, run the following command:

```bash
cp -r ../cogservicesNative ../examples/ionic-angular/node_modules/@ionic-native/
cp -r ../cognitiveservices ../examples/ionic-angular/node_modules/@ionic-native/
```

While this should install all components, there have been a few changes to
Expand All @@ -108,11 +108,11 @@ cordova platform remove ios
cordova platform add ios
```

## Run it Application
## Run the Application

### Run on Browser

To run the application, in a terminal window, browse to the speecthtoText folder
To run the application, in a terminal window, browse to the examples/ionic-angular folder
and run the following:

```bash
Expand Down
47 changes: 47 additions & 0 deletions cognitiveservices/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
import { IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs';
/**
* @name cognitiveservices
* @description
* This plugin does something
*
* @usage
* ```typescript
* import { cognitiveservices } from '@ionic-native/cognitiveservices';
*
*
* constructor(private cognitiveservices: cognitiveservices) { }
*
* ...
*
*
* this.cognitiveservices.functionName('Hello', 123)
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
*
* ```
*/
export interface SpeechVoiceOptions {
language?: string;
pitch?: string;
voice?: string;
}
export declare class CognitiveServicesOriginal extends IonicNativePlugin {
/**
* This function does something
* @param arg1 {string} Some param to configure something
* @param arg2 {number} Another param to configure something
* @return {Promise<any>} Returns a promise that resolves when something happens
*/
SetSubscription(speechSubscriptionKey: string, serviceRegion: string): Promise<void>;
RecognizeFromMicrophone(): Observable<Array<Object>>;
SpeakSsml(speechText: string): Promise<string>;
SpeakSsmlAsync(speechText: string): Promise<string>;
SpeakText(speechText: string): Promise<string>;
SpeakTextAsync(speechText: string): Promise<string>;
StopListening(): Promise<void>;
SpeakWithVoiceOptions(speechText: string, options?: SpeechVoiceOptions): Promise<void>;
SpeakStop(): Promise<void>;
}

export declare const CognitiveServices: CognitiveServicesOriginal;
39 changes: 39 additions & 0 deletions cognitiveservices/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

45 changes: 45 additions & 0 deletions cognitiveservices/ngx/index.d.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
import { IonicNativePlugin } from '@ionic-native/core';
import { Observable } from 'rxjs';
/**
* @name cognitiveservices
* @description
* This plugin does something
*
* @usage
* ```typescript
* import { cognitiveservices } from '@ionic-native/cognitiveservices';
*
*
* constructor(private cognitiveservices: cognitiveservices) { }
*
* ...
*
*
* this.cognitiveservices.functionName('Hello', 123)
* .then((res: any) => console.log(res))
* .catch((error: any) => console.error(error));
*
* ```
*/
export interface SpeechVoiceOptions {
language?: string;
pitch?: string;
voice?: string;
}
export declare class CognitiveServices extends IonicNativePlugin {
/**
* This function does something
* @param arg1 {string} Some param to configure something
* @param arg2 {number} Another param to configure something
* @return {Promise<any>} Returns a promise that resolves when something happens
*/
SetSubscription(speechSubscriptionKey: string, serviceRegion: string): Promise<void>;
RecognizeFromMicrophone(): Observable<Array<Object>>;
SpeakSsml(speechText: string): Promise<string>;
SpeakSsmlAsync(speechText: string): Promise<string>;
SpeakText(speechText: string): Promise<string>;
SpeakTextAsync(speechText: string): Promise<string>;
StopListening(): Promise<void>;
SpeakWithVoiceOptions(speechText: string, options?: SpeechVoiceOptions): Promise<void>;
SpeakStop(): Promise<void>;
}
48 changes: 48 additions & 0 deletions cognitiveservices/ngx/index.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

42 changes: 42 additions & 0 deletions cognitiveservices/ngx/index.metadata.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
[
{
"__symbolic": "module",
"version": 4,
"metadata": {
"SpeechVoiceOptions": { "__symbolic": "interface" },
"CognitiveServices": {
"__symbolic": "class",
"extends": {
"__symbolic": "reference",
"module": "@ionic-native/core",
"name": "IonicNativePlugin",
"line": 40,
"character": 39
},
"decorators": [
{
"__symbolic": "call",
"expression": {
"__symbolic": "reference",
"module": "@angular/core",
"name": "Injectable",
"line": 39,
"character": 1
}
}
],
"members": {
"SetSubscription": [{ "__symbolic": "method" }],
"RecognizeFromMicrophone": [{ "__symbolic": "method" }],
"SpeakSsml": [{ "__symbolic": "method" }],
"SpeakSsmlAsync": [{ "__symbolic": "method" }],
"SpeakText": [{ "__symbolic": "method" }],
"SpeakTextAsync": [{ "__symbolic": "method" }],
"StopListening": [{ "__symbolic": "method" }],
"SpeakWithVoiceOptions": [{ "__symbolic": "method" }],
"SpeakStop": [{ "__symbolic": "method" }]
}
}
}
}
]
Loading

0 comments on commit f29a90f

Please sign in to comment.