Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Simple Youdao Translate] Fail to read words. #5366

Closed
hongzzz opened this issue Mar 15, 2023 · 13 comments
Closed

[Simple Youdao Translate] Fail to read words. #5366

hongzzz opened this issue Mar 15, 2023 · 13 comments
Labels
bug Something isn't working extension: simple-youdao Issues related to the simple-youdao extension extension Issues related to one of the extensions in the Store

Comments

@hongzzz
Copy link

hongzzz commented Mar 15, 2023

Extension

https://www.raycast.com/xeric/simple-youdao

Description

Error:

Error: Command failed: afplay "/tmp/tmp_raycast_simpleyd.mp3" -v 1
Error: AudioFileOpen failed ('dta?')


Error: AudioFileOpen failed ('dta?')
ChildProcess.exithandler:node:child_process:412:12
ChildProcess.emit:node:events:513:28

Steps To Reproduce

No response

Current Behaviour

No response

Expected Behaviour

No response

@hongzzz hongzzz added bug Something isn't working extension Issues related to one of the extensions in the Store labels Mar 15, 2023
@raycastbot raycastbot added the extension: simple-youdao Issues related to the simple-youdao extension label Mar 15, 2023
@raycastbot
Copy link
Collaborator

Thank you for opening this issue!

🔔 @xeric you might want to have a look.

💡 Tip: Once the issue is resolved, comment @raycastbot close this issue to close it.

@xeric
Copy link
Contributor

xeric commented Mar 20, 2023

Hi @hongzzz
Thanks for reporting the issue, does this issue happened recently or it never works?
Could you help to check below?

  1. visit http://dict.youdao.com/dictvoice?audio=test, check if there's any connectivity issue, if works, check next one.
  2. if file '/tmp/tmp_raycast_simpleyd.mp3' is existing, if yes, check next one.
  3. please help to run cmd afplay "/tmp/tmp_raycast_simpleyd.mp3" -v 1 from your terminal.

The actual process of pronunciation is downloading the audio file and use afplay command to play it.
I tested it locally, works fine, I need to understand if the problem in your side is in download phase or command execution phase.

@hongzzz
Copy link
Author

hongzzz commented Mar 20, 2023

Hi @hongzzz Thanks for reporting the issue, does this issue happened recently or it never works? Could you help to check below?

  1. visit http://dict.youdao.com/dictvoice?audio=test, check if there's any connectivity issue, if works, check next one.
  2. if file '/tmp/tmp_raycast_simpleyd.mp3' is existing, if yes, check next one.
  3. please help to run cmd afplay "/tmp/tmp_raycast_simpleyd.mp3" -v 1 from your terminal.

The actual process of pronunciation is downloading the audio file and use afplay command to play it. I tested it locally, works fine, I need to understand if the problem in your side is in download phase or command execution phase.

Hey @xeric , I tried that both 1 and 2 were successful. But for 3, it can not be played.

Here is screenshot.
image

And I tried to open the file via IINA and Quicktime player, also failed
image

@hongzzz
Copy link
Author

hongzzz commented Mar 20, 2023

Maybe the issue is related to downloading an MP3 file.

@xeric
Copy link
Contributor

xeric commented Mar 20, 2023

@hongzzz Thanks for your information!
your browser can access the audio file, but when the file downloaded, it could not be openned.
What is the size of this mp3 file? If it is not zero size, would you mind to upload this local mp3 file to somewhere for my investigation?

@hongzzz
Copy link
Author

hongzzz commented Mar 20, 2023

@xeric Its size is 70 bytes.

Here is the link

@hongzzz
Copy link
Author

hongzzz commented Mar 20, 2023

I found that the MP3 file failed to download.
Its content is response data json.

image

@xeric
Copy link
Contributor

xeric commented Mar 21, 2023

@hongzzz yes, I feel there's something wrong with your youdao audio url accessing, but you said it works fine in your browser, right? If yes, means the behavior in browser and in Raycast they are different, did you setup any proxy or special DNS for your Raycast? or your browser has setup some proxy or DNS to make it work?
Or can you try it in different network environment?

@hongzzz
Copy link
Author

hongzzz commented Mar 21, 2023

Raycast is the same network env with my browser.

@xeric
Copy link
Contributor

xeric commented Mar 21, 2023

That's tricky.
Since I totally could not reproduce the issue, would you mind try below:
Create a Script Command in Raycast, choose nodejs as Template, give a name such as 'Download Youdao MP3'.
In created js file, put below code:

const url = 'http://dict.youdao.com/dictvoice?audio=test';

fetch(url).then(resp => {console.log(resp.status); resp.text().then(json => console.log(json))});

save it, run from raycast, check the output of the script command, I printed status code and content in this code.

@hongzzz
Copy link
Author

hongzzz commented Mar 21, 2023

@xeric Thanks for your help. I just discovered the issue - I had not turned on the TTS function, which resulted in error code 110.

https://ai.youdao.com/DOCSIRMA/html/%E8%87%AA%E7%84%B6%E8%AF%AD%E8%A8%80%E7%BF%BB%E8%AF%91/API%E6%96%87%E6%A1%A3/%E6%9C%89%E9%81%93%E8%AF%8D%E5%85%B8%E6%9C%8D%E5%8A%A1/%E6%9C%89%E9%81%93%E8%AF%8D%E5%85%B8%E6%9C%8D%E5%8A%A1-API%E6%96%87%E6%A1%A3.html

@xeric
Copy link
Contributor

xeric commented Mar 21, 2023

oh, I see, I did not realize that the audio file is from the pronunciation link of API, I thought your case would run into fallback url, thanks for your feedback and glad to see it turn to work now.

@xeric
Copy link
Contributor

xeric commented Mar 21, 2023

@raycastbot close this issue

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working extension: simple-youdao Issues related to the simple-youdao extension extension Issues related to one of the extensions in the Store
Projects
None yet
Development

No branches or pull requests

3 participants