{"id":6955,"date":"2024-10-09T10:09:00","date_gmt":"2024-10-09T02:09:00","guid":{"rendered":"https:\/\/www.aisharenet.com\/?p=6955"},"modified":"2025-07-16T04:41:29","modified_gmt":"2025-07-15T20:41:29","slug":"deepgram","status":"publish","type":"post","link":"https:\/\/www.kdjingpai.com\/en\/deepgram\/","title":{"rendered":"Deepgram\uff1a\u9ad8\u7cbe\u5ea6\u8bed\u97f3\u8bc6\u522b\u548c\u5408\u6210\u89e3\u51b3\u65b9\u6848\u670d\u52a1API"},"content":{"rendered":"<p>Deepgram\u662f\u4e00\u5bb6\u4e13\u6ce8\u4e8e\u8bed\u97f3\u8bc6\u522b\u548c\u81ea\u7136\u8bed\u8a00\u5904\u7406\u6280\u672f\u7684\u516c\u53f8\uff0c\u63d0\u4f9b\u5f3a\u5927\u7684\u8bed\u97f3\u5230\u6587\u672c\uff08Speech-to-Text\uff09\u548c\u6587\u672c\u5230\u8bed\u97f3\uff08Text-to-Speech\uff09API\u3002\u8be5\u5e73\u53f0\u5229\u7528\u5148\u8fdb\u7684\u4eba\u5de5\u667a\u80fd\u6280\u672f\uff0c\u5e2e\u52a9\u5f00\u53d1\u8005\u5c06\u8bed\u97f3\u8f6c\u5f55\u548c\u7406\u89e3\u529f\u80fd\u96c6\u6210\u5230\u4ed6\u4eec\u7684\u5e94\u7528\u7a0b\u5e8f\u548c\u670d\u52a1\u4e2d\u3002Deepgram\u7684\u89e3\u51b3\u65b9\u6848\u5e7f\u6cdb\u5e94\u7528\u4e8e\u533b\u7597\u8f6c\u5f55\u3001\u81ea\u52a8\u5316\u5ba2\u670d\u3001\u64ad\u5ba2\u8f6c\u5f55\u7b49\u591a\u4e2a\u9886\u57df\uff0c\u81f4\u529b\u4e8e\u63d0\u5347\u4eba\u673a\u4ea4\u4e92\u7684\u6548\u7387\u548c\u4f53\u9a8c\u3002<\/p>\n<p>&nbsp;<\/p>\n<p><img loading=\"lazy\" decoding=\"async\" class=\"aligncenter size-full wp-image-6956\" title=\"Deepgram-1\" src=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/10\/4fae2f2563d9e90.png\" alt=\"Deepgram-1\" width=\"1920\" height=\"911\" srcset=\"https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/10\/4fae2f2563d9e90.png 1920w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/10\/4fae2f2563d9e90-300x142.png 300w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/10\/4fae2f2563d9e90-1024x486.png 1024w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/10\/4fae2f2563d9e90-768x364.png 768w, https:\/\/www.kdjingpai.com\/wp-content\/uploads\/2024\/10\/4fae2f2563d9e90-1536x729.png 1536w\" sizes=\"auto, (max-width: 1920px) 100vw, 1920px\" \/><\/p>\n<p>&nbsp;<\/p>\n<h2>\u529f\u80fd\u5217\u8868<\/h2>\n<ul>\n<li><strong>\u8bed\u97f3\u5230\u6587\u672c\uff08Speech-to-Text\uff09<\/strong>\uff1a\u63d0\u4f9b\u9ad8\u7cbe\u5ea6\u3001\u4f4e\u5ef6\u8fdf\u7684\u8bed\u97f3\u8f6c\u6587\u672c\u670d\u52a1\uff0c\u652f\u6301\u591a\u79cd\u8bed\u8a00\u548c\u53e3\u97f3\u3002<\/li>\n<li><strong>\u6587\u672c\u5230\u8bed\u97f3\uff08Text-to-Speech\uff09<\/strong>\uff1a\u751f\u6210\u81ea\u7136\u6d41\u7545\u7684\u8bed\u97f3\u8f93\u51fa\uff0c\u9002\u7528\u4e8e\u5b9e\u65f6AI\u548c\u9ad8\u541e\u5410\u91cf\u5e94\u7528\u3002<\/li>\n<li><strong>\u97f3\u9891\u667a\u80fd\uff08Audio Intelligence\uff09<\/strong>\uff1a\u63d0\u4f9b\u97f3\u9891\u5206\u6790\u548c\u7406\u89e3\u529f\u80fd\uff0c\u5e2e\u52a9\u4f01\u4e1a\u8fdb\u884c\u5927\u89c4\u6a21\u97f3\u9891\u6570\u636e\u5206\u6790\u3002<\/li>\n<li><strong>\u8bed\u97f3\u4ee3\u7406API\uff08Voice Agent API\uff09<\/strong>\uff1a\u652f\u6301\u4eba\u673a\u81ea\u7136\u5bf9\u8bdd\u7684\u7edf\u4e00\u8bed\u97f3API\uff0c\u9002\u7528\u4e8e\u5404\u79cd\u81ea\u52a8\u5316\u5e94\u7528\u573a\u666f\u3002<\/li>\n<\/ul>\n<p>&nbsp;<\/p>\n<h2>\u4f7f\u7528\u5e2e\u52a9<\/h2>\n<h4>\u5b89\u88c5\u4e0e\u4f7f\u7528<\/h4>\n<ol>\n<li><strong>\u6ce8\u518c\u8d26\u6237<\/strong>\uff1a\u8bbf\u95eeDeepgram\u5b98\u7f51\uff0c\u6ce8\u518c\u4e00\u4e2a\u65b0\u8d26\u6237\u3002<\/li>\n<li><strong>\u83b7\u53d6API\u5bc6\u94a5<\/strong>\uff1a\u767b\u5f55\u8d26\u6237\u540e\uff0c\u5728\u63a7\u5236\u53f0\u83b7\u53d6API\u5bc6\u94a5\u3002<\/li>\n<li><strong>\u96c6\u6210API<\/strong>\uff1a\n<ul>\n<li><strong>\u8bed\u97f3\u8f6c\u6587\u672c\uff08STT\uff09<\/strong>\uff1a\n<div class=\"code-header\" tabindex=\"-1\">\n<p><span class=\"code-lang\">Python<\/span><\/p>\n<div class=\"code-actions\"><\/div>\n<\/div>\n<div class=\"code\" tabindex=\"-1\">\n<pre><code class=\"language-python\"><span class=\"hljs-keyword\">import<\/span> requests\r\n\r\nurl = <span class=\"hljs-string\">\"https:\/\/api.deepgram.com\/v1\/listen\"<\/span>\r\nheaders = {\r\n    <span class=\"hljs-string\">\"Authorization\"<\/span>: <span class=\"hljs-string\">\"<a href=\"https:\/\/www.kdjingpai.com\/en\/tokenization\/\">Token<\/a> YOUR_API_KEY\"<\/span>,\r\n    <span class=\"hljs-string\">\"Content-Type\"<\/span>: <span class=\"hljs-string\">\"application\/json\"<\/span>\r\n}\r\ndata = {\r\n    <span class=\"hljs-string\">\"url\"<\/span>: <span class=\"hljs-string\">\"https:\/\/path.to\/your\/audio\/file.wav\"<\/span>\r\n}\r\nresponse = requests.post(url, headers=headers, json=data)\r\n<span class=\"hljs-built_in\">print<\/span>(response.json())\r\n<\/code><\/pre>\n<\/div>\n<div class=\"code-footer\"><span class=\"footer-disclaimer\">AI \u751f\u6210\u7684\u4ee3\u7801\u3002\u4ed4\u7ec6\u67e5\u770b\u548c\u4f7f\u7528\u3002\u00a0<a href=\"https:\/\/www.bing.com\/new#faq\" target=\"_blank\" rel=\"noopener\">\u6709\u5173\u5e38\u89c1\u95ee\u9898\u89e3\u7b54\u7684\u8be6\u7ec6\u4fe1\u606f<\/a>.<\/span><\/div>\n<\/li>\n<li><strong>\u6587\u672c\u8f6c\u8bed\u97f3\uff08TTS\uff09<\/strong>\uff1a\n<div class=\"code-header\" tabindex=\"-1\">\n<p><span class=\"code-lang\">Python<\/span><\/p>\n<div class=\"code-actions\"><\/div>\n<\/div>\n<div class=\"code\" tabindex=\"-1\">\n<pre><code class=\"language-python\"><span class=\"hljs-keyword\">import<\/span> requests\r\n\r\nurl = <span class=\"hljs-string\">\"https:\/\/api.deepgram.com\/v1\/speak\"<\/span>\r\nheaders = {\r\n    <span class=\"hljs-string\">\"Authorization\"<\/span>: <span class=\"hljs-string\">\"Token YOUR_API_KEY\"<\/span>,\r\n    <span class=\"hljs-string\">\"Content-Type\"<\/span>: <span class=\"hljs-string\">\"application\/json\"<\/span>\r\n}\r\ndata = {\r\n    <span class=\"hljs-string\">\"text\"<\/span>: <span class=\"hljs-string\">\"Hello, this is a test.\"<\/span>,\r\n    <span class=\"hljs-string\">\"voice\"<\/span>: <span class=\"hljs-string\">\"en_us_male\"<\/span>\r\n}\r\nresponse = requests.post(url, headers=headers, json=data)\r\n<span class=\"hljs-keyword\">with<\/span> <span class=\"hljs-built_in\">open<\/span>(<span class=\"hljs-string\">\"output.wav\"<\/span>, <span class=\"hljs-string\">\"wb\"<\/span>) <span class=\"hljs-keyword\">as<\/span> f:\r\n    f.write(response.content)\r\n<\/code><\/pre>\n<\/div>\n<div class=\"code-footer\"><span class=\"footer-disclaimer\">AI \u751f\u6210\u7684\u4ee3\u7801\u3002\u4ed4\u7ec6\u67e5\u770b\u548c\u4f7f\u7528\u3002\u00a0<a href=\"https:\/\/www.bing.com\/new#faq\" target=\"_blank\" rel=\"noopener\">\u6709\u5173\u5e38\u89c1\u95ee\u9898\u89e3\u7b54\u7684\u8be6\u7ec6\u4fe1\u606f<\/a>.<\/span><\/div>\n<\/li>\n<\/ul>\n<\/li>\n<li><strong>\u5b9e\u65f6\u8bed\u97f3\u5904\u7406<\/strong>\uff1a\u4f7f\u7528WebSocket\u8fde\u63a5\u5b9e\u73b0\u5b9e\u65f6\u8bed\u97f3\u8bc6\u522b\u3002\n<div class=\"code-header\" tabindex=\"-1\">\n<p><span class=\"code-lang\">Python<\/span><\/p>\n<div class=\"code-actions\"><\/div>\n<\/div>\n<div class=\"code\" tabindex=\"-1\">\n<pre><code class=\"language-python\"><span class=\"hljs-keyword\">import<\/span> websocket\r\n<span class=\"hljs-keyword\">import<\/span> json\r\n\r\n<span class=\"hljs-keyword\">def<\/span> <span class=\"hljs-title function_\">on_message<\/span>(<span class=\"hljs-params\">ws, message<\/span>):\r\n    <span class=\"hljs-built_in\">print<\/span>(json.loads(message))\r\n\r\nws = websocket.WebSocketApp(\r\n    <span class=\"hljs-string\">\"wss:\/\/api.deepgram.com\/v1\/listen\"<\/span>,\r\n    header={<span class=\"hljs-string\">\"Authorization\"<\/span>: <span class=\"hljs-string\">\"Token YOUR_API_KEY\"<\/span>},\r\n    on_message=on_message\r\n)\r\nws.run_forever()\r\n<\/code><\/pre>\n<\/div>\n<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<h3>\u8bed\u97f3\u5230\u6587\u672c\uff08Speech-to-Text\uff09\u4f7f\u7528\u6307\u5357<\/h3>\n<ol>\n<li><strong>\u96c6\u6210API<\/strong>\uff1a\u5728\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\u4e2d\u96c6\u6210Deepgram\u7684Speech-to-Text API\u3002\u4f60\u53ef\u4ee5\u53c2\u8003\u5b98\u65b9\u6587\u6863\u4e2d\u7684\u793a\u4f8b\u4ee3\u7801\u8fdb\u884c\u96c6\u6210\u3002<\/li>\n<li><strong>\u4e0a\u4f20\u97f3\u9891\u6587\u4ef6<\/strong>\uff1a\u901a\u8fc7API\u4e0a\u4f20\u9700\u8981\u8f6c\u5f55\u7684\u97f3\u9891\u6587\u4ef6\uff0c\u652f\u6301\u591a\u79cd\u97f3\u9891\u683c\u5f0f\u3002<\/li>\n<li><strong>\u83b7\u53d6\u8f6c\u5f55\u7ed3\u679c<\/strong>\uff1aAPI\u4f1a\u8fd4\u56de\u8f6c\u5f55\u540e\u7684\u6587\u672c\u7ed3\u679c\uff0c\u4f60\u53ef\u4ee5\u5728\u5e94\u7528\u7a0b\u5e8f\u4e2d\u8fdb\u884c\u8fdb\u4e00\u6b65\u5904\u7406\u548c\u5c55\u793a\u3002<\/li>\n<\/ol>\n<h3>\u6587\u672c\u5230\u8bed\u97f3\uff08Text-to-Speech\uff09\u4f7f\u7528\u6307\u5357<\/h3>\n<ol>\n<li><strong>\u96c6\u6210API<\/strong>\uff1a\u5728\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\u4e2d\u96c6\u6210Deepgram\u7684Text-to-Speech API\u3002<\/li>\n<li><strong>\u8f93\u5165\u6587\u672c<\/strong>\uff1a\u901a\u8fc7API\u8f93\u5165\u9700\u8981\u8f6c\u6362\u4e3a\u8bed\u97f3\u7684\u6587\u672c\u5185\u5bb9\u3002<\/li>\n<li><strong>\u83b7\u53d6\u8bed\u97f3\u8f93\u51fa<\/strong>\uff1aAPI\u4f1a\u8fd4\u56de\u751f\u6210\u7684\u8bed\u97f3\u6587\u4ef6\uff0c\u4f60\u53ef\u4ee5\u5728\u5e94\u7528\u7a0b\u5e8f\u4e2d\u64ad\u653e\u6216\u5b58\u50a8\u3002<\/li>\n<\/ol>\n<h3>\u97f3\u9891\u667a\u80fd\uff08Audio Intelligence\uff09\u4f7f\u7528\u6307\u5357<\/h3>\n<ol>\n<li><strong>\u96c6\u6210API<\/strong>\uff1a\u5728\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\u4e2d\u96c6\u6210Deepgram\u7684Audio Intelligence API\u3002<\/li>\n<li><strong>\u4e0a\u4f20\u97f3\u9891\u6587\u4ef6<\/strong>\uff1a\u901a\u8fc7API\u4e0a\u4f20\u9700\u8981\u5206\u6790\u7684\u97f3\u9891\u6587\u4ef6\u3002<\/li>\n<li><strong>\u83b7\u53d6\u5206\u6790\u7ed3\u679c<\/strong>\uff1aAPI\u4f1a\u8fd4\u56de\u97f3\u9891\u5206\u6790\u7ed3\u679c\uff0c\u5305\u62ec\u60c5\u611f\u5206\u6790\u3001\u5173\u952e\u8bcd\u63d0\u53d6\u7b49\u4fe1\u606f\u3002<\/li>\n<\/ol>\n<h3>\u8bed\u97f3\u4ee3\u7406API\uff08Voice Agent API\uff09\u4f7f\u7528\u6307\u5357<\/h3>\n<ol>\n<li><strong>\u96c6\u6210API<\/strong>\uff1a\u5728\u4f60\u7684\u5e94\u7528\u7a0b\u5e8f\u4e2d\u96c6\u6210Deepgram\u7684Voice Agent API\u3002<\/li>\n<li><strong>\u914d\u7f6e\u5bf9\u8bdd\u6a21\u578b<\/strong>\uff1a\u6839\u636e\u5e94\u7528\u573a\u666f\u914d\u7f6e\u9002\u5408\u7684\u5bf9\u8bdd\u6a21\u578b\u3002<\/li>\n<li><strong>\u5b9e\u73b0\u4eba\u673a\u5bf9\u8bdd<\/strong>\uff1a\u901a\u8fc7API\u5b9e\u73b0\u81ea\u7136\u6d41\u7545\u7684\u4eba\u673a\u5bf9\u8bdd\uff0c\u63d0\u5347\u7528\u6237\u4f53\u9a8c\u3002<\/li>\n<\/ol>\n<p>&nbsp;<\/p>\n<p>\u6ce8\u518c\u540e\u8d60\u9001200\u5200\u989d\u5ea6\uff0c\u53ef\u8c03\u7528\u5168\u7cfb\u5217API\u3002<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Deepgram\u662f\u4e00\u5bb6\u4e13\u6ce8\u4e8e\u8bed\u97f3\u8bc6\u522b\u548c\u81ea\u7136\u8bed\u8a00\u5904\u7406\u6280\u672f\u7684\u516c\u53f8\uff0c\u63d0\u4f9b\u5f3a\u5927\u7684\u8bed\u97f3\u5230\u6587\u672c\uff08Speech-to-Text\uff09\u548c\u6587\u672c\u5230\u8bed\u97f3\uff08Text-to-Speech\uff09API\u3002\u8be5\u5e73\u53f0\u5229\u7528\u5148\u8fdb\u7684\u4eba\u5de5\u667a\u80fd\u6280\u672f\uff0c\u5e2e\u52a9\u5f00\u53d1\u8005\u5c06\u8bed\u97f3\u8f6c\u5f55\u548c\u7406\u89e3\u529f\u80fd\u96c6\u6210\u5230\u4ed6\u4eec\u7684\u5e94&#8230;<\/p>\n","protected":false},"author":1,"featured_media":32547,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[425,496,20],"tags":[208,216],"class_list":["post-6955","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-ai-professional","category-ai-basic-services","category-tool","tag-aikaifangfuwu","tag-aiyuyinzhuanwenben"],"_links":{"self":[{"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/posts\/6955","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/comments?post=6955"}],"version-history":[{"count":0,"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/posts\/6955\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/media\/32547"}],"wp:attachment":[{"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/media?parent=6955"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/categories?post=6955"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kdjingpai.com\/en\/wp-json\/wp\/v2\/tags?post=6955"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}