現在 Dolby の拡張 API を使用しようとしていますが、出力ファイルを書き込もうとすると問題が発生します。入力ブロブと出力ブロブのブロブを取得するために使用しているコードは次のとおりです。
file = await storage_client.get_capture_file(capture.filename)
input_file = file.generate_signed_url(
version="v4",
expiration=datetime.timedelta(minutes=15),
method="GET",
)
blob = storage_client.capture_bucket.blob(
"{}_{}".format(preset, capture.filename)
if preset
else "{}_{}_{}_{}_{}".format(
speech_isolation,
range_control,
noise_reduction,
peak_limit,
capture.filename,
)
)
output_file = blob.generate_signed_url(
version="v4",
expiration=datetime.timedelta(minutes=15),
method="PUT",
content_type="application/octet-stream",
)
Dolby の一時ストレージに書き込めば問題ないので、入力ファイルは問題なく動作します。これが私のペイロードとAPI呼び出しです
payload = {
"content": {"type": "mobile_phone"},
...
"input": input_file,
"output": output_file,
}
headers = {
"Accept": "application/json",
"Content-Type": "application/json",
"x-api-key": os.environ.get("DOLBY_API_KEY"),
}
enhance_response = requests.request(
"POST", "https://api.dolby.com/media/enhance", json=payload, headers=headers
)
私が受け取っている特定のエラーは次のとおりです。
{'path': '/media/enhance', 'status': 'InternalError', 'progress': 43, 'api_version': 'v1.1.2', 'error': {'type': '/problems/internal-error', 'title': 'An internal service error has occurred'}}
この問題は、新しいファイルを GCP にアップロードすることに関係していると思います。正確な問題が何であるかはよくわかりません。任意のガイダンスをいただければ幸いです。