GV

GeezerVison

The World Wide Web, restored to 800 pixels of glory.

Home|About|Gaming cabinet|Archives|How it works|Starter sites

On this site

  • Sign in
  • ActionsCI/CD and automation
  • CodespacesCloud development environments
  • All Features
  • Documentation
  • Training
  • Certifications
  • Build with Copilot
  • Customize Copilot
  • Integrations
  • Trending repos
  • GitHub Sponsors
  • Developer articles
  • Enterprises

This view

  • Original page
  • New address

GeezerVison is showing github.com — Add fixes for Speech and Visual Recognition · morristech/java-sdk@9a0ede8

File tree

Expand file treeCollapse file tree
Open diff view settings
Filter options
  • .travis.yml
  • .utility
    • deploy.sh
    • push-javadoc-to-gh-pages.sh
  • core/src/main/java/com/ibm/watson/developer_cloud/http
    • HttpMediaType.java
  • speech-to-text
    • README.md
    • src
      • main/java/com/ibm/watson/developer_cloud/speech_to_text/v1
        • SpeechToText.java
        • model
          • Customization.java
          • RecognizeOptions.java
          • SpeechModel.java
        • util
          • MediaTypeUtils.java
      • test/java/com/ibm/watson/developer_cloud/speech_to_text/v1
        • SpeechToTextTest.java
  • visual-recognition/src
    • main/java/com/ibm/watson/developer_cloud/visual_recognition/v3
      • VisualRecognition.java
    • test/java/com/ibm/watson/developer_cloud/visual_recognition/v3
      • VisualRecognitionIT.java
Expand file treeCollapse file tree
Open diff view settings
Collapse file

‎.travis.yml‎

Copy file name to clipboardExpand all lines: .travis.yml
+16-3Lines changed: 16 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -39,8 +39,21 @@ script:
3939

4040
after_success:
4141
- bash <(curl -s https://codecov.io/bash)
42-
- .utility/push-javadoc-to-gh-pages.sh
43-
- .utility/deploy.sh
42+
43+
deploy:
44+
- provider: script
45+
script: .utility/push-javadoc-to-gh-pages.sh
46+
skip_cleanup: true
47+
on:
48+
repo: watson-developer-cloud/java-sdk
49+
jdk: oraclejdk7
50+
51+
- provider: script
52+
script: .utility/deploy.sh
53+
skip_cleanup: true
54+
on:
55+
repo: watson-developer-cloud/java-sdk
56+
jdk: oraclejdk7
4457

4558
notifications:
46-
email: false
59+
email: true
Collapse file

‎.utility/deploy.sh‎

Copy file name to clipboard
+1-4Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,6 @@
11
#!/usr/bin/env bash
22

3-
if [ "$TRAVIS_REPO_SLUG" == "watson-developer-cloud/java-sdk" ] && \
4-
[ "$TRAVIS_JDK_VERSION" == "oraclejdk7" ] && \
5-
[ "$TRAVIS_PULL_REQUEST" == "false" ] && \
6-
[ "$TRAVIS_BRANCH" == "master" ]; then
3+
if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" == "master" ]; then
74
openssl aes-256-cbc -K $encrypted_bdb9d73a7940_key -iv $encrypted_bdb9d73a7940_iv -in .utility/cd/secring.gpg.enc -out .utility/cd/secring.gpg -d
85
./gradlew uploadArchives -Psigning.keyId=$SIGNING_KEY -Psigning.password=$SIGNING_PASSWORD -Psigning.secretKeyRingFile=$KEYRING_PATH -PossrhUsername=$OSSRH_JIRA_USERNAME -PossrhPassword=$OSSRH_JIRA_PASSWORD
96
fi
Collapse file

‎.utility/push-javadoc-to-gh-pages.sh‎

Copy file name to clipboardExpand all lines: .utility/push-javadoc-to-gh-pages.sh
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
#!/bin/bash
22

3-
if [ "$TRAVIS_REPO_SLUG" == "watson-developer-cloud/java-sdk" ] && [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" ] && [ "$TRAVIS_BUILD_NUMBER.1" == "$TRAVIS_JOB_NUMBER" ]; then
3+
if [ "$TRAVIS_PULL_REQUEST" == "false" ] && [ "$TRAVIS_BRANCH" ]; then
44

55
git config --global user.email "[email protected]"
66
git config --global user.name "Watson Github Bot"
Collapse file

‎core/src/main/java/com/ibm/watson/developer_cloud/http/HttpMediaType.java‎

Copy file name to clipboardExpand all lines: core/src/main/java/com/ibm/watson/developer_cloud/http/HttpMediaType.java
+15Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -120,6 +120,21 @@ private HttpMediaType() {
120120
public static final String AUDIO_FLAC = "audio/flac";
121121

122122
/**
123+
* Field AUDIO_MULAW. (value is "audio/mulaw")
124+
*/
125+
public static final String AUDIO_MULAW = "audio/mulaw";
126+
127+
/**
128+
* Field AUDIO_MP3. (value is "audio/mp3")
129+
*/
130+
public static final String AUDIO_MP3 = "audio/mp3";
131+
132+
/**
133+
* Field AUDIO_MPEG. (value is "audio/mpeg")
134+
*/
135+
public static final String AUDIO_MPEG = "audio/mpeg";
136+
137+
/**
123138
* Field AUDIO_RAW. (value is "audio/l16") <br>
124139
* When using in Speech to Text a sample rate must be provided
125140
*/
Collapse file

‎speech-to-text/README.md‎

Copy file name to clipboardExpand all lines: speech-to-text/README.md
-1Lines changed: 0 additions & 1 deletion
  • Display the source diff
  • Display the rich diff
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ service.setUsernameAndPassword("<username>", "<password>");
4141
File audio = new File("src/test/resources/sample1.wav");
4242

4343
RecognizeOptions options = new RecognizeOptions.Builder()
44-
.continuous(true)
4544
.interimResults(true)
4645
.contentType(HttpMediaType.AUDIO_WAV)
4746
.build();
Collapse file

‎speech-to-text/src/main/java/com/ibm/watson/developer_cloud/speech_to_text/v1/SpeechToText.java‎

Copy file name to clipboardExpand all lines: speech-to-text/src/main/java/com/ibm/watson/developer_cloud/speech_to_text/v1/SpeechToText.java
+17-1Lines changed: 17 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -366,9 +366,10 @@ public ServiceCall<Void> addWords(String customizationId, Word... words) {
366366
* @param baseModel The name of the language model that is to be customized by the new model. e.g:
367367
* 'en-US_BroadbandModel'.
368368
* @param description the customization description
369+
* @param dialect the language dialect
369370
* @return the service call with the GUID which identifies the created custom model.
370371
*/
371-
public ServiceCall<Customization> createCustomization(String name, SpeechModel baseModel, String description) {
372+
public ServiceCall<Customization> createCustomization(String name, SpeechModel baseModel, String description, String dialect) {
372373
Validator.notNull(name, "name cannot be null");
373374
Validator.notNull(baseModel, "baseModel cannot be null");
374375

@@ -378,9 +379,24 @@ public ServiceCall<Customization> createCustomization(String name, SpeechModel b
378379
newCustomization.setBaseModelName(baseModel.getName());
379380
newCustomization.setDescription(description);
380381
newCustomization.setName(name);
382+
if (dialect != null)
383+
newCustomization.setDialect(dialect);
381384
requestBuilder.bodyContent(GSON.toJson(newCustomization), HttpMediaType.APPLICATION_JSON);
382385
return createServiceCall(requestBuilder.build(), ResponseConverterUtils.getObject(Customization.class));
383386
}
387+
388+
/**
389+
* Creates the customization.
390+
*
391+
* @param name The customization name
392+
* @param baseModel The name of the language model that is to be customized by the new model. e.g:
393+
* 'en-US_BroadbandModel'.
394+
* @param description the customization description
395+
* @return the service call with the GUID which identifies the created custom model.
396+
*/
397+
public ServiceCall<Customization> createCustomization(String name, SpeechModel baseModel, String description) {
398+
return createCustomization(name, baseModel, description, null);
399+
}
384400

385401
/**
386402
* Creates an asynchronous recognition request.
Collapse file

‎speech-to-text/src/main/java/com/ibm/watson/developer_cloud/speech_to_text/v1/model/Customization.java‎

Copy file name to clipboardExpand all lines: speech-to-text/src/main/java/com/ibm/watson/developer_cloud/speech_to_text/v1/model/Customization.java
+27-5Lines changed: 27 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ public class Customization extends GenericModel {
3333
* </ul>
3434
*/
3535
public enum WordTypeToAdd {
36+
37+
/** The all. */
3638
ALL, /** The corpora and user words. */
3739
USER /** The user words. */
3840
}
@@ -59,7 +61,7 @@ public enum Status {
5961
}
6062

6163
@SerializedName("customization_id")
62-
private String customizationId;
64+
private String id;
6365

6466
private Date created;
6567

@@ -80,22 +82,42 @@ public enum Status {
8082

8183
private String warnings;
8284

85+
private String dialect;
86+
8387
/**
8488
* Gets the customization id.
8589
*
8690
* @return The customizationId
8791
*/
8892
public String getId() {
89-
return customizationId;
93+
return id;
94+
}
95+
96+
/**
97+
* Gets the dialect of the language that is to be used with the custom model.
98+
*
99+
* @return the dialect
100+
*/
101+
public String getDialect() {
102+
return dialect;
103+
}
104+
105+
/**
106+
* Sets the dialect of the language that is to be used with the custom model.
107+
*
108+
* @param dialect the new dialect
109+
*/
110+
public void setDialect(String dialect) {
111+
this.dialect = dialect;
90112
}
91113

92114
/**
93115
* Sets the customization id.
94116
*
95-
* @param customizationId The customization_id
117+
* @param id The customization id
96118
*/
97-
public void setId(String customizationId) {
98-
this.customizationId = customizationId;
119+
public void setId(String id) {
120+
this.id = id;
99121
}
100122

101123
/**
Collapse file

‎speech-to-text/src/main/java/com/ibm/watson/developer_cloud/speech_to_text/v1/model/RecognizeOptions.java‎

Copy file name to clipboardExpand all lines: speech-to-text/src/main/java/com/ibm/watson/developer_cloud/speech_to_text/v1/model/RecognizeOptions.java
+8-3Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,11 +86,14 @@ public RecognizeOptions build() {
8686
* The format of the audio data specified as one of the following values: <br>
8787
* <ul>
8888
* <li><code>audio/flac</code> for Free Lossless Audio Codec (FLAC)</li>
89-
* <li><code>audio/l16</code> for Linear 16-bit Pulse-Code Modulation (PCM).</li>
89+
* <li><code>audio/l16</code> for Linear 16-bit Pulse-Code Modulation (PCM)</li>
90+
* <li><code>audio/mp3</code> for MP3</li>
91+
* <li><code>audio/mpeg</code> for MPEG-1</li>
92+
* <li><code>audio/mulaw</code> for Mulaw</li>
93+
* <li><code>audio/webm</code> for Webm</li>
9094
* <li><code>audio/wav</code> for Waveform Audio File Format (WAV)</li>
91-
* <li><code>audio/ogg;codecs=opus</code> for Ogg format files that use the opus codec</li>
95+
* <li><code>audio/ogg;codecs=opus</code> for OGG format files that use the opus codec</li>
9296
* </ul>
93-
* .
9497
*
9598
* @param contentType the content type
9699
* @return the recognize options
@@ -146,9 +149,11 @@ public Builder profanityFilter(Boolean profanityFilter) {
146149
}
147150

148151
/**
152+
*
149153
* If true, multiple final results that represent multiple consecutive phrases separated by pauses are returned.
150154
* Otherwise, the recognition ends after first "end of speech" is detected.
151155
*
156+
* @deprecated
152157
* @param continuous the continuous
153158
* @return the recognize options
154159
*/
Collapse file

‎speech-to-text/src/main/java/com/ibm/watson/developer_cloud/speech_to_text/v1/model/SpeechModel.java‎

Copy file name to clipboardExpand all lines: speech-to-text/src/main/java/com/ibm/watson/developer_cloud/speech_to_text/v1/model/SpeechModel.java
+11-1Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,19 @@ public void setSpeakerLabels(final Boolean speakerLabels) {
7474
public static final SpeechModel AR_AR_BROADBANDMODEL = new SpeechModel("ar-AR_BroadbandModel");
7575

7676
/** UK English broadband model. */
77-
public static final SpeechModel EN_UK_BROADBANDMODEL = new SpeechModel("en-UK_BroadbandModel");
77+
public static final SpeechModel EN_GB_BROADBANDMODEL = new SpeechModel("en-GB_BroadbandModel");
7878

7979
/** UK English narrowband model. */
80+
public static final SpeechModel EN_GB_NARROWBANDMODEL = new SpeechModel("en-GB_NarrowbandModel");
81+
82+
/**
83+
* @deprecated Use {@link SpeechModel#EN_GB_BROADBANDMODEL}.
84+
*/
85+
public static final SpeechModel EN_UK_BROADBANDMODEL = new SpeechModel("en-UK_BroadbandModel");
86+
87+
/**
88+
* @deprecated Use {@link SpeechModel#EN_GB_NARROWBANDMODEL}.
89+
*/
8090
public static final SpeechModel EN_UK_NARROWBANDMODEL = new SpeechModel("en-UK_NarrowbandModel");
8191

8292
/** US English broadband model. */
Collapse file

‎speech-to-text/src/main/java/com/ibm/watson/developer_cloud/speech_to_text/v1/util/MediaTypeUtils.java‎

Copy file name to clipboardExpand all lines: speech-to-text/src/main/java/com/ibm/watson/developer_cloud/speech_to_text/v1/util/MediaTypeUtils.java
+2Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,8 @@ public final class MediaTypeUtils {
3636
MEDIA_TYPES.put(".oga", HttpMediaType.AUDIO_OGG);
3737
MEDIA_TYPES.put(".flac", HttpMediaType.AUDIO_FLAC);
3838
MEDIA_TYPES.put(".raw", HttpMediaType.AUDIO_RAW);
39+
MEDIA_TYPES.put(".mp3", HttpMediaType.AUDIO_MP3);
40+
MEDIA_TYPES.put(".mpeg", HttpMediaType.AUDIO_MPEG);
3941
MEDIA_TYPES.put(".webm", HttpMediaType.AUDIO_WEBM);
4042
}
4143

0 commit comments

Comments
0 (0)
You are visitor 01402792 — GeezerVison does not store the pages you look up.
Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required.