Giter VIP home page Giter VIP logo

Comments (18)

iamserious avatar iamserious commented on August 12, 2024 1

My Session info:

sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Catalina 10.15.5

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] googleLanguageR_0.3.0

loaded via a namespace (and not attached):
[1] magrittr_1.5 R6_2.4.1 rlang_0.4.6 fansi_0.4.1 httr_1.4.1 tools_3.6.3 cli_2.0.2
[8] googleAuthR_1.3.0 askpass_1.1 ellipsis_0.3.1 openssl_1.4.2 assertthat_0.2.1 digest_0.6.25 tibble_3.0.1
[15] gargle_0.5.0 lifecycle_0.2.0 crayon_1.3.4 purrr_0.3.4 base64enc_0.1-3 vctrs_0.3.1 fs_1.4.2
[22] curl_4.3 memoise_1.1.0 glue_1.4.1 compiler_3.6.3 pillar_1.4.4 jsonlite_1.7.0 pkgconfig_2.0.3

from googlelanguager.

MarkEdmondson1234 avatar MarkEdmondson1234 commented on August 12, 2024

Looks like something underlying the API or library, are you behind a proxy perhaps? Perhaps check that the authentication process is correct by running some of the other functions such as gl_translate() examples. If you run the code with options(googleAuthR.verbose=2) we will get a bit more logging info to try and deduce what is happening.

from googlelanguager.

iamserious avatar iamserious commented on August 12, 2024

Whoah. what a fast answer.

Nop I'm not behind a proxy. Will Check the more verbosed output first.

from googlelanguager.

iamserious avatar iamserious commented on August 12, 2024

Ok with the verbosed output I'm getting:

gl_speech(test_audio)$transcript
ℹ 2020-07-02 10:48:05 > Token exists.
ℹ 2020-07-02 10:48:05 > Request: https://speech.googleapis.com/v1/speech:recognize/
ℹ 2020-07-02 10:48:05 > Body JSON parsed to: {"config":{"encoding":"LINEAR16","sampleRateHertz":16000,"languageCode":"en-US","maxAlternatives":1,"profanityFilter":false,"speechContexts":{},"enableWordTimeOffsets":true},"audio":{"content": [base code audio i think]

and after that nothing happens.

Will check the other apis but have to enable them first.

from googlelanguager.

iamserious avatar iamserious commented on August 12, 2024

Ok I tried it out with gl_translate and that works flawlessly:

gl_translate(text, target = "da")$translatedText
2020-07-02 10:55:58 -- Translating text: 114 characters -
ℹ 2020-07-02 10:55:58 > Token exists.
ℹ 2020-07-02 10:55:58 > Request: https://translation.googleapis.com/language/translate/v2/
[1] "at administrere medicin til dyr er ofte en meget vanskelig sag, og alligevel er det undertiden nødvendigt at gøre det"

translate British into Danish

It seems to have something to do with the speech to text api.

from googlelanguager.

MarkEdmondson1234 avatar MarkEdmondson1234 commented on August 12, 2024

Hmm ok thanks, it looks ok so nothing obvious, I'll investigate, perhaps test the example audio just in case.

One thing you may try also is use another PC or rstudio.cloud to see if you get the same issue, to see if we can see if its something to do with your setup.

from googlelanguager.

iamserious avatar iamserious commented on August 12, 2024

Good Idea will change to the setup of my colleague.

FYI:
I tried it wit R 4.0.2 as well as 3.6.3. R-studio version is 1.3.959

from googlelanguager.

MarkEdmondson1234 avatar MarkEdmondson1234 commented on August 12, 2024

Could you also report your sessionInfo() ? Mine is below, which I've confirmed works with the code in your issue:

> sessionInfo()
R version 3.6.3 (2020-02-29)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS Catalina 10.15.5

Matrix products: default
BLAS:   /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.6/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats     graphics  grDevices utils     datasets  methods   base     

other attached packages:
[1] googleLanguageR_0.3.0

loaded via a namespace (and not attached):
 [1] Rcpp_1.0.4.6           rstudioapi_0.11        googleAnalyticsR_0.8.0
 [4] magrittr_1.5           tidyselect_1.1.0       R6_2.4.1              
 [7] rlang_0.4.6            fansi_0.4.1            httr_1.4.1            
[10] dplyr_1.0.0            tools_3.6.3            packrat_0.5.0         
[13] utf8_1.1.4             cli_2.0.2              withr_2.1.2           
[16] googleAuthR_1.3.0      askpass_1.1            cranlogs_2.1.1        
[19] ellipsis_0.3.0         openssl_1.4.1          assertthat_0.2.1      
[22] digest_0.6.25          tibble_3.0.0           gargle_0.4.0          
[25] lifecycle_0.2.0        crayon_1.3.4           tidyr_1.0.2           
[28] purrr_0.3.3            base64enc_0.1-3        vctrs_0.3.1           
[31] fs_1.4.1               curl_4.3               memoise_1.1.0         
[34] glue_1.4.1             compiler_3.6.3         pillar_1.4.3          
[37] generics_0.0.2         jsonlite_1.6.1         pkgconfig_2.0.3

from googlelanguager.

iamserious avatar iamserious commented on August 12, 2024

Ok I tried it out on my colleagues machine, same result :(

sessionInfo()
R version 3.5.1 (2018-07-02)
Platform: x86_64-apple-darwin15.6.0 (64-bit)
Running under: macOS 10.15.4

Matrix products: default
BLAS: /System/Library/Frameworks/Accelerate.framework/Versions/A/Frameworks/vecLib.framework/Versions/A/libBLAS.dylib
LAPACK: /Library/Frameworks/R.framework/Versions/3.5/Resources/lib/libRlapack.dylib

locale:
[1] en_US.UTF-8/en_US.UTF-8/en_US.UTF-8/C/en_US.UTF-8/en_US.UTF-8

attached base packages:
[1] stats graphics grDevices utils datasets methods base

other attached packages:
[1] googleLanguageR_0.3.0

loaded via a namespace (and not attached):
[1] Rcpp_1.0.3 fansi_0.4.1 digest_0.6.16 crayon_1.3.4 assertthat_0.2.0
[6] R6_2.2.2 jsonlite_1.6.1 magrittr_1.5 pillar_1.4.3 httr_1.4.1
[11] rlang_0.4.5 cli_2.0.2 curl_3.2 rstudioapi_0.11 fs_1.3.2
[16] googleAuthR_1.3.0 tools_3.5.1 glue_1.3.0 purrr_0.3.3 yaml_2.2.0
[21] compiler_3.5.1 askpass_1.1 pkgconfig_2.0.2 base64enc_0.1-3 gargle_0.5.0
[26] memoise_1.1.0 openssl_1.4.1 tibble_2.1.3

Still a time out error. I also tried every step, routing my traffic over an vpn (to make sure it is not a internet problem) but didn't change anything.

from googlelanguager.

MarkEdmondson1234 avatar MarkEdmondson1234 commented on August 12, 2024

Hmm really don't know where to start sorry, you have the same setup as me and the auth works for other services - I can only think its some kind of firewall or network issue if you are using the same connection as your colleague.

from googlelanguager.

iamserious avatar iamserious commented on August 12, 2024

Example audio file also works with out problems. Checked that now.

from googlelanguager.

MarkEdmondson1234 avatar MarkEdmondson1234 commented on August 12, 2024

Oh the example audio file works, but the audio file you are trying doesn't? In that case it must be the audio encoding of the file?

from googlelanguager.

MarkEdmondson1234 avatar MarkEdmondson1234 commented on August 12, 2024

Does your file work on the website demo? https://cloud.google.com/speech-to-text

from googlelanguager.

iamserious avatar iamserious commented on August 12, 2024

Nop, the example files work if played in quicktime.

In general I don't get the error every time. Every now and than (maybe in 5% of the cases) I also got the text back from the gl_speech call

from googlelanguager.

MarkEdmondson1234 avatar MarkEdmondson1234 commented on August 12, 2024

Ok so the example audio file works 5% of cases?

But the audio file you are trying to transcribe never works?

It says to me its network connection issues, it is uploading a big chunk of audio that perhaps your corporate firewall blocks (most of the time) - you could try uploading your audio to Google Cloud Storage instead and using its URI so it has a secure upload. Also your example audio needs proper encoding (of which there are millions) - if you try the audio in the website perhaps you can see if it accepts it at all. There is more on audio encoding here: https://cloud.google.com/speech-to-text/docs/encoding

from googlelanguager.

iamserious avatar iamserious commented on August 12, 2024

Yes, the example file works in around 5% of the cases and my own files never work.
I coded my own file as wav, but also tried out flac and mp3 before.

If I try both files (example and my own, both as wav) on the demo webpage the work without any problems (besides asking me if i'm a robot every time).

Actually I don't think the the firewall is a problem. I'm in Home Office at the moment and here I have a standard DSL connection and if I use the VPN, I'm connected with the DFN (German research network) which is by default extremely relaxed in there firewall setting.

I now have tried out the demo webpage with my own audio file and the webpage also fails some times and gives me an "unauthorized" or a "server errror" message.

from googlelanguager.

iamserious avatar iamserious commented on August 12, 2024

It really seems to be somehow due to the transmission. I have now uploaded the data to a bucket in the gcloud and now it works.
I couldn't get it to work directly from the client. In the meantime I would have thought that there was a problem with the encoding of the audio file in json, because my computer was 100% busy on one core while trying to execute the request.

from googlelanguager.

MarkEdmondson1234 avatar MarkEdmondson1234 commented on August 12, 2024

Ok cool, glad its working now at least. If you want to automate the uploads there is cloudyr/googleCloudStorageR which will give you the URI for use in gl_speech()

from googlelanguager.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.