我是个编程新手。我在我正在使用的一个小程序上使用Google Cloud Text to Speech API for Python。函数工作正常,我得到了合成语音的结果,但MP3文件与我需要的文件不同。我选择‘en-GB-Wavenet-C’(英国口音女声)作为language_code,但是MP3文件听起来是美国口音的男声。 我访问了云Text to Speech应用程序接口网站(https://cloud.google.com/text-to-speech/),并尝试了“说出来”演示。我试了试'en-GB-Wavenet-C‘,它听起来像是英国口音的女声。 我想知道适当的代码,
我正在玩Google Cloud Speech API。我想知道,如果我使用python语音识别库并调用google cloud speech API,这仍然是使用API的有效方式吗?我只想抄写这篇文章。
我对它们之间的区别感到困惑,如果我只是想转录音频,是否有任何建议的方法。
使用Python SpeechRecognition:
import speech_recognition as sr
r = sr.Recognizer()
r.recognize_google_cloud()
harvard = sr.AudioFile('harvard.wav')
with ha
使用Google-Speech- to -Text,我可以用默认参数转录音频剪辑。但是,在使用enable_speaker_diarization标签分析音频剪辑中的各个扬声器时,我收到错误消息。谷歌文档它here这是一个很长的识别音频剪辑,因此我使用异步请求,谷歌推荐的here 我的代码是- def transcribe_gcs(gcs_uri):
from google.cloud import speech
from google.cloud import speech_v1 as speech
from google.cloud.speech import enums
from go
我试图在我的统一应用程序中包括谷歌语音api。
我遵循了c# 的api文档中的所有步骤。我通过Google.Cloud.Speech.V1包管理器安装了这个包“installed”,但是没有显示google引用。这导致错误“无法找到类型或名称空间名称'Google‘(您是缺少了一个使用指令还是程序集引用?)。我检查了这些可能的副本,但没有使用"“、"”。将统一平台从android切换到windows显示的是google引用,但没有解决错误。
using Google.Cloud.Speech.V1;
using System;
namespace GoogleClou
下面是我的代码(我对原始示例代码做了一些细微的更改):
import io
import os
# Imports the Google Cloud client library
from google.cloud import speech
from google.cloud.speech import enums
from google.cloud.speech import types
# Instantiates a client
client = speech.SpeechClient()
# The name of the audio file to transcribe
f
当我在英语音频文件中使用'languageCode' => 'en-US'时,Google对我来说很好。但是当将'languageCode' => 'ja-JP'与日文音频文件一起使用时,它会返回像"Transcription: ã‚‚ã—ã‚‚ã—è² ã‘ホンダã—ã¦ã‚‚ã—ã‚‚ã—"这样的破碎文本。
来自google的示例代码:
# Includes the autoloader for libraries installed with composer
require __DI
当使用python作为脚本触发时,下面的代码可以正常工作。但同样,当我封装在芹菜任务中并尝试执行时,它不起作用。芹菜任务打印long_running_recognize之前的行,但不打印操作后的行-在作为芹菜任务执行时,它似乎被long_running_recognize调用卡住了。
#!/usr/bin/env python3
import speech_recognition as sr
import json
import sqlalchemy
import io
import os
# Imports the Google Cloud client library
from g
我有一个现场录音的网址,我正在尝试使用谷歌语音到文本API转录。我使用的是来自Cloud Speech to Text API的示例代码。然而,问题是,当我传递活动的url时,我没有收到任何输出。下面是我的代码的相关部分。任何帮助都将不胜感激!
from google.cloud import speech
from google.cloud.speech import enums
from google.cloud.speech import types
import io
import os
import time
import requests
import numpy as np
fr
我正在尝试导入Google的文本到语音库
composer require google/cloud-text-to-speech
但是我得到了这个错误
Using version ^0.4.4 for google/cloud-text-to-speech
./composer.json has been updated
Loading composer repositories with package information
Updating dependencies (including require-dev)
Your requirements could not be resol
我使用这个谷歌云文本来演讲,就像他们在他们的网站上写的一样。https://codelabs.developers.google.com/codelabs/cloud-text-speech-csharp/#6 ) 但是没有关于如何获取输出Wavenet voices (Ssml)的详细信息。这个编码输出是正常的声音。 我的问题是,使用这段代码,我如何适应人类的口音(Wavenet或Ssml voieces)? using Google.Cloud.TextToSpeech.V1;
using System;
using System.IO;
namespace TextToSpeechA
我正在尝试在.net中使用Google Speech API v1,但在打电话时遇到了挑战。
下面是我的代码。
Dim userSpeech = Google.Cloud.Speech.V1.SpeechClient.Create
Dim response = userSpeech.Recognize(New RecognitionConfig, RecognitionAudio.FromFile(filePath))
For Each result In response.Results
For Each alternative In result.Alternatives
为了让文本到语音转换API在GCE上的Python脚本中工作,我尝试使用在GCE下运行的以下代码: """Synthesizes speech from the input string of text or ssml.
Note: ssml must be well-formed according to:
https://www.w3.org/TR/speech-synthesis/
"""
# Authorize server-to-server interactions from Google Compute Engine.
我刚刚在Google Cloud平台上注册了一个免费的Tier帐户,并获得了api密钥来复制以下代码:
import os
import speech_recognition as sr
from tqdm import tqdm
with open("api-key.json") as f:
GOOGLE_CLOUD_SPEECH_CREDENTIALS = f.read()
r = sr.Recognizer()
files = sorted(os.listdir('parts/'))
all_text = []
for f in tqdm(
我一直在尝试从运行以下代码。
import io
import os
# Imports the Google Cloud client library
from google.cloud import speech
from google.cloud.speech import enums
from google.cloud.speech import types
# Instantiates a client
client = speech.SpeechClient()
# The name of the audio file to transcribe
file_name = os
我使用spyder作为我的演讲到文本转换项目使用google到text。我已经将google语音集成到我的代码中,并得到了类似“配额耗尽”之类的错误。在谷歌控制台的仪表板上,我可以看到可用的配额。
import speech_recognition as sr
r = sr.Recognizer()
sample_call = sr.AudioFile('sample_call_new.flac')
with sample_call as source:
audio = r.record(source)
type(audio)
response = r.rec
我是新手,并试图使用谷歌云语音文本与python和多重处理。这里有一个简单的例子来重现我的问题。我在Windows上运行代码。
当我在没有多处理的情况下运行代码时,它可以正常工作。
import io
from tqdm import tqdm
from multiprocessing import Pool, freeze_support, cpu_count
from google.cloud import speech
from google.cloud.speech import enums
from google.cloud.speech import types
# Insta